Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
774c4a91
提交
774c4a91
authored
7月 16, 2016
作者:
sentient07
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding __props__ to all the Ops that has __init__
上级
f66ea7e8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
0 行删除
+17
-0
op.py
theano/gof/op.py
+1
-0
basic.py
theano/scalar/basic.py
+2
-0
elemwise.py
theano/tensor/elemwise.py
+12
-0
test_basic.py
theano/tensor/tests/test_basic.py
+2
-0
没有找到文件。
theano/gof/op.py
浏览文件 @
774c4a91
...
...
@@ -781,6 +781,7 @@ class Op(utils.object2, PureOp, CLinkerOp):
Convenience class to bundle `PureOp` and `CLinkerOp`.
"""
def
prepare_node
(
self
,
node
,
storage_map
,
compute_map
,
impl
):
"""
Make any special modifications that the Op needs before doing
...
...
theano/scalar/basic.py
浏览文件 @
774c4a91
...
...
@@ -853,6 +853,8 @@ class ScalarOp(Op):
nin
=
-
1
nout
=
1
__props__
=
(
"output_types_preference"
,
"name"
)
def
__init__
(
self
,
output_types_preference
=
None
,
name
=
None
):
self
.
name
=
name
if
output_types_preference
is
not
None
:
...
...
theano/tensor/elemwise.py
浏览文件 @
774c4a91
...
...
@@ -476,6 +476,7 @@ second dimension
| Elemwise(log)(rand(3, 4, 5))
"""
__props__
=
(
"scalar_op"
,
"inplace_pattern"
,
"name"
,
"nfunc_spec"
,
"openmp"
)
def
__init__
(
self
,
scalar_op
,
inplace_pattern
=
None
,
name
=
None
,
nfunc_spec
=
None
,
openmp
=
None
):
...
...
@@ -1334,6 +1335,8 @@ class CAReduce(Op):
"""
__props__
=
(
"scalar_op"
,
"axis"
)
def
__init__
(
self
,
scalar_op
,
axis
=
None
):
if
scalar_op
.
nin
not
in
[
-
1
,
2
]
or
scalar_op
.
nout
!=
1
:
raise
NotImplementedError
((
...
...
@@ -1714,6 +1717,7 @@ class All(CAReduce):
Equivalent to `CAReduce(scalar.and
\
_, axis=axis)`.
"""
__props__
=
(
"axis"
)
def
__init__
(
self
,
axis
=
None
):
CAReduce
.
__init__
(
self
,
scalar
.
and_
,
axis
)
...
...
@@ -1746,6 +1750,7 @@ class Any(CAReduce):
Equivalent to `CAReduce(scalar.or
\
_, axis=axis)`.
"""
__props__
=
(
"axis"
)
def
__init__
(
self
,
axis
=
None
):
CAReduce
.
__init__
(
self
,
scalar
.
or_
,
axis
)
...
...
@@ -1823,6 +1828,7 @@ class CAReduceDtype(CAReduce):
* for complex dtypes, we use at least complex128.
"""
__props__
=
(
"scalar_op"
,
"axis"
,
"dtype"
,
"acc_dtype"
)
def
__init__
(
self
,
scalar_op
,
axis
=
None
,
dtype
=
None
,
acc_dtype
=
None
):
CAReduce
.
__init__
(
self
,
scalar_op
,
axis
=
axis
)
...
...
@@ -1981,6 +1987,8 @@ class Sum(CAReduceDtype):
"""
__props__
=
(
"axis"
,
"dtype"
,
"acc_dtype"
)
def
__init__
(
self
,
axis
=
None
,
dtype
=
None
,
acc_dtype
=
None
):
CAReduceDtype
.
__init__
(
self
,
scalar
.
add
,
axis
=
axis
,
dtype
=
dtype
,
acc_dtype
=
acc_dtype
)
...
...
@@ -2029,6 +2037,7 @@ class Prod(CAReduceDtype):
input.
"""
__props__
=
(
"axis"
,
"dtype"
,
"acc_dtype"
)
def
__init__
(
self
,
axis
=
None
,
dtype
=
None
,
acc_dtype
=
None
,
no_zeros_in_input
=
False
):
...
...
@@ -2211,6 +2220,9 @@ mul_without_zeros = MulWithoutZeros(scalar.upcast_out,
class
ProdWithoutZeros
(
CAReduceDtype
):
__props__
=
(
"axis"
,
"dtype"
,
"acc_dtype"
)
def
__init__
(
self
,
axis
=
None
,
dtype
=
None
,
acc_dtype
=
None
):
CAReduceDtype
.
__init__
(
self
,
mul_without_zeros
,
axis
=
axis
,
dtype
=
dtype
,
acc_dtype
=
acc_dtype
)
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
774c4a91
...
...
@@ -2246,6 +2246,8 @@ AllocDimshuffleGradTester2 = makeBroadcastTester(
class
ApplyDefaultTestOp
(
theano
.
Op
):
__props__
=
(
"id"
)
def
__init__
(
self
,
id
):
self
.
default_output
=
id
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论