Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0da30159
提交
0da30159
authored
9月 30, 2016
作者:
sentient07
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added few more __props__, added __str__ method to Sum class, cleanup
上级
b7622fd6
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
6 行删除
+17
-6
basic.py
theano/scalar/basic.py
+5
-3
elemwise.py
theano/tensor/elemwise.py
+12
-1
test_basic.py
theano/tensor/tests/test_basic.py
+0
-2
没有找到文件。
theano/scalar/basic.py
浏览文件 @
0da30159
...
@@ -852,7 +852,6 @@ class ScalarOp(Op):
...
@@ -852,7 +852,6 @@ class ScalarOp(Op):
nin
=
-
1
nin
=
-
1
nout
=
1
nout
=
1
__props__
=
(
"output_types_preference"
,
"name"
)
__props__
=
(
"output_types_preference"
,
"name"
)
def
__init__
(
self
,
output_types_preference
=
None
,
name
=
None
):
def
__init__
(
self
,
output_types_preference
=
None
,
name
=
None
):
...
@@ -1185,6 +1184,7 @@ isinf = IsInf()
...
@@ -1185,6 +1184,7 @@ isinf = IsInf()
class
InRange
(
LogicalComparison
):
class
InRange
(
LogicalComparison
):
nin
=
3
nin
=
3
__props__
=
(
"openlow"
,
"openhi"
)
def
__init__
(
self
,
openlow
,
openhi
):
def
__init__
(
self
,
openlow
,
openhi
):
self
.
openlow
=
openlow
self
.
openlow
=
openlow
...
@@ -2036,6 +2036,8 @@ identity = Identity(same_out, name='identity')
...
@@ -2036,6 +2036,8 @@ identity = Identity(same_out, name='identity')
# CASTING OPERATIONS
# CASTING OPERATIONS
class
Cast
(
UnaryScalarOp
):
class
Cast
(
UnaryScalarOp
):
__props__
=
(
"o_type"
,
"name"
)
def
__init__
(
self
,
o_type
,
name
=
None
):
def
__init__
(
self
,
o_type
,
name
=
None
):
if
not
isinstance
(
o_type
,
Scalar
):
if
not
isinstance
(
o_type
,
Scalar
):
raise
TypeError
(
o_type
)
raise
TypeError
(
o_type
)
...
@@ -3461,7 +3463,7 @@ class Composite(ScalarOp):
...
@@ -3461,7 +3463,7 @@ class Composite(ScalarOp):
Composite depends on all the Ops in its graph having C code.
Composite depends on all the Ops in its graph having C code.
"""
"""
init_param
=
(
'inputs'
,
'outputs'
)
__props__
=
(
'inputs'
,
'outputs'
)
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
name
is
None
:
if
self
.
name
is
None
:
...
@@ -3475,7 +3477,7 @@ class Composite(ScalarOp):
...
@@ -3475,7 +3477,7 @@ class Composite(ScalarOp):
This fct allow fix patch this.
This fct allow fix patch this.
"""
"""
d
=
dict
([(
k
,
getattr
(
self
,
k
))
for
k
in
self
.
init_param
])
d
=
dict
([(
k
,
getattr
(
self
,
k
))
for
k
in
self
.
__props__
])
out
=
self
.
__class__
(
**
d
)
out
=
self
.
__class__
(
**
d
)
if
name
:
if
name
:
out
.
name
=
name
out
.
name
=
name
...
...
theano/tensor/elemwise.py
浏览文件 @
0da30159
...
@@ -476,7 +476,6 @@ second dimension
...
@@ -476,7 +476,6 @@ second dimension
| Elemwise(log)(rand(3, 4, 5))
| 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
,
def
__init__
(
self
,
scalar_op
,
inplace_pattern
=
None
,
name
=
None
,
nfunc_spec
=
None
,
openmp
=
None
):
nfunc_spec
=
None
,
openmp
=
None
):
...
@@ -1993,6 +1992,18 @@ class Sum(CAReduceDtype):
...
@@ -1993,6 +1992,18 @@ class Sum(CAReduceDtype):
CAReduceDtype
.
__init__
(
self
,
scalar
.
add
,
axis
=
axis
,
CAReduceDtype
.
__init__
(
self
,
scalar
.
add
,
axis
=
axis
,
dtype
=
dtype
,
acc_dtype
=
acc_dtype
)
dtype
=
dtype
,
acc_dtype
=
acc_dtype
)
def
__str__
(
self
):
name
=
self
.
__class__
.
__name__
axis
=
""
if
self
.
axis
is
not
None
:
axis
=
", "
.
join
(
str
(
x
)
for
x
in
self
.
axis
)
axis
=
"axis=[
%
s], "
%
axis
return
"
%
s{
%
sacc_dtype=
%
s}"
%
(
name
,
axis
,
str
(
self
.
acc_dtype
)
)
def
grad
(
self
,
inp
,
grads
):
def
grad
(
self
,
inp
,
grads
):
x
,
=
inp
x
,
=
inp
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
0da30159
...
@@ -2246,8 +2246,6 @@ AllocDimshuffleGradTester2 = makeBroadcastTester(
...
@@ -2246,8 +2246,6 @@ AllocDimshuffleGradTester2 = makeBroadcastTester(
class
ApplyDefaultTestOp
(
theano
.
Op
):
class
ApplyDefaultTestOp
(
theano
.
Op
):
__props__
=
(
"id"
)
def
__init__
(
self
,
id
):
def
__init__
(
self
,
id
):
self
.
default_output
=
id
self
.
default_output
=
id
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论