Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f1716914
提交
f1716914
authored
7月 29, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed a couple of self._info in theano/tensor/io.py
上级
b27c3d9c
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
12 行删除
+7
-12
io.py
theano/tensor/io.py
+7
-12
没有找到文件。
theano/tensor/io.py
浏览文件 @
f1716914
...
@@ -18,6 +18,8 @@ class LoadFromDisk(Op):
...
@@ -18,6 +18,8 @@ class LoadFromDisk(Op):
@note: Non-differentiable.
@note: Non-differentiable.
"""
"""
__props__
=
(
"dtype"
,
"broadcastable"
,
"mmap_mode"
)
def
__init__
(
self
,
dtype
,
broadcastable
,
mmap_mode
=
None
):
def
__init__
(
self
,
dtype
,
broadcastable
,
mmap_mode
=
None
):
self
.
dtype
=
numpy
.
dtype
(
dtype
)
# turn "float64" into numpy.float64
self
.
dtype
=
numpy
.
dtype
(
dtype
)
# turn "float64" into numpy.float64
self
.
broadcastable
=
broadcastable
self
.
broadcastable
=
broadcastable
...
@@ -25,13 +27,6 @@ class LoadFromDisk(Op):
...
@@ -25,13 +27,6 @@ class LoadFromDisk(Op):
raise
ValueError
(
"The only supported values for mmap_mode "
raise
ValueError
(
"The only supported values for mmap_mode "
"are None and 'c', got
%
s"
%
mmap_mode
)
"are None and 'c', got
%
s"
%
mmap_mode
)
self
.
mmap_mode
=
mmap_mode
self
.
mmap_mode
=
mmap_mode
self
.
_info
=
(
dtype
,
broadcastable
,
mmap_mode
)
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
_info
==
other
.
_info
)
def
__hash__
(
self
):
return
hash
((
type
(
self
),)
+
self
.
_info
)
def
make_node
(
self
,
path
):
def
make_node
(
self
,
path
):
if
isinstance
(
path
,
str
):
if
isinstance
(
path
,
str
):
...
@@ -50,7 +45,8 @@ class LoadFromDisk(Op):
...
@@ -50,7 +45,8 @@ class LoadFromDisk(Op):
out
[
0
][
0
]
=
result
out
[
0
][
0
]
=
result
def
__str__
(
self
):
def
__str__
(
self
):
return
"Load{dtype:
%
s, broadcastable:
%
s, mmep:
%
s}"
%
self
.
_info
return
(
"Load{dtype:
%
s, broadcastable:
%
s, mmep:
%
s}"
%
(
self
.
dtype
,
self
.
broadcastable
,
self
.
mmap_mode
))
def
load
(
path
,
dtype
,
broadcastable
,
mmap_mode
=
None
):
def
load
(
path
,
dtype
,
broadcastable
,
mmap_mode
=
None
):
...
@@ -111,7 +107,6 @@ class MPIRecv(Op):
...
@@ -111,7 +107,6 @@ class MPIRecv(Op):
self
.
shape
=
shape
self
.
shape
=
shape
self
.
dtype
=
numpy
.
dtype
(
dtype
)
# turn "float64" into numpy.float64
self
.
dtype
=
numpy
.
dtype
(
dtype
)
# turn "float64" into numpy.float64
self
.
broadcastable
=
(
False
,)
*
len
(
shape
)
self
.
broadcastable
=
(
False
,)
*
len
(
shape
)
self
.
_info
=
(
source
,
tag
,
shape
,
dtype
)
def
make_node
(
self
):
def
make_node
(
self
):
return
gof
.
Apply
(
self
,
[],
[
theano
.
Variable
(
Generic
()),
return
gof
.
Apply
(
self
,
[],
[
theano
.
Variable
(
Generic
()),
...
@@ -127,7 +122,8 @@ class MPIRecv(Op):
...
@@ -127,7 +122,8 @@ class MPIRecv(Op):
out
[
1
][
0
]
=
data
out
[
1
][
0
]
=
data
def
__str__
(
self
):
def
__str__
(
self
):
return
"MPIRecv{source:
%
d, tag:
%
d, shape:
%
s, dtype:
%
s}"
%
self
.
_info
return
(
"MPIRecv{source:
%
d, tag:
%
d, shape:
%
s, dtype:
%
s}"
%
(
self
.
source
,
self
.
tag
,
self
.
shape
,
self
.
dtype
))
def
infer_shape
(
self
,
node
,
shapes
):
def
infer_shape
(
self
,
node
,
shapes
):
return
[
None
,
self
.
shape
]
return
[
None
,
self
.
shape
]
...
@@ -185,7 +181,6 @@ class MPISend(Op):
...
@@ -185,7 +181,6 @@ class MPISend(Op):
def
__init__
(
self
,
dest
,
tag
):
def
__init__
(
self
,
dest
,
tag
):
self
.
dest
=
dest
self
.
dest
=
dest
self
.
tag
=
tag
self
.
tag
=
tag
self
.
_info
=
(
dest
,
tag
)
def
make_node
(
self
,
data
):
def
make_node
(
self
,
data
):
return
gof
.
Apply
(
self
,
[
data
],
return
gof
.
Apply
(
self
,
[
data
],
...
@@ -202,7 +197,7 @@ class MPISend(Op):
...
@@ -202,7 +197,7 @@ class MPISend(Op):
out
[
1
][
0
]
=
data
out
[
1
][
0
]
=
data
def
__str__
(
self
):
def
__str__
(
self
):
return
"MPISend{dest:
%
d, tag:
%
d}"
%
self
.
_info
return
"MPISend{dest:
%
d, tag:
%
d}"
%
(
self
.
dest
,
self
.
tag
)
class
MPISendWait
(
Op
):
class
MPISendWait
(
Op
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论