Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
14671ad3
Unverified
提交
14671ad3
authored
4月 01, 2020
作者:
Frédéric Bastien
提交者:
GitHub
4月 01, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6747 from rebecca-palmer/py38_syntaxwarnings
MAINT: Avoid SyntaxWarnings on import in Python 3.8
上级
473d74ea
0da749df
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
mode.py
theano/compile/mode.py
+1
-1
op.py
theano/gof/op.py
+4
-4
opt.py
theano/gof/opt.py
+1
-1
test_link.py
theano/gof/tests/test_link.py
+1
-1
bn.py
theano/tensor/nnet/bn.py
+1
-1
test_conv.py
theano/tensor/nnet/tests/test_conv.py
+1
-1
test_determinism.py
theano/tests/test_determinism.py
+1
-1
没有找到文件。
theano/compile/mode.py
浏览文件 @
14671ad3
...
...
@@ -261,7 +261,7 @@ class Mode(object):
def
__init__
(
self
,
linker
=
None
,
optimizer
=
'default'
):
if
linker
is
None
:
linker
=
config
.
linker
if
optimizer
is
'default'
:
if
type
(
optimizer
)
==
str
and
optimizer
==
'default'
:
optimizer
=
config
.
optimizer
Mode
.
__setstate__
(
self
,
(
linker
,
optimizer
))
...
...
theano/gof/op.py
浏览文件 @
14671ad3
...
...
@@ -1540,12 +1540,12 @@ class COp(Op):
undef_macros
=
[]
for
i
,
inp
in
enumerate
(
inputs
):
define_macros
.
append
(
"#define INPUT_
%
d
%
s"
(
i
,
inp
))
undef_macros
.
append
(
"#undef INPUT_
%
d"
,
(
i
,))
define_macros
.
append
(
"#define INPUT_
%
d
%
s"
%
(
i
,
inp
))
undef_macros
.
append
(
"#undef INPUT_
%
d"
%
(
i
,))
for
i
,
out
in
enumerate
(
outputs
):
define_macros
.
append
(
"#define OUTPUT_
%
d
%
s"
(
i
,
inp
))
undef_macros
.
append
(
"#undef OUTPUT_
%
d"
,
(
i
,))
define_macros
.
append
(
"#define OUTPUT_
%
d
%
s"
%
(
i
,
inp
))
undef_macros
.
append
(
"#undef OUTPUT_
%
d"
%
(
i
,))
def
c_init_code_struct
(
self
,
node
,
name
,
sub
):
"""
...
...
theano/gof/opt.py
浏览文件 @
14671ad3
...
...
@@ -1284,7 +1284,7 @@ def local_optimizer(tracks, inplace=False, requirements=()):
"""
if
tracks
is
not
None
:
if
len
(
tracks
)
is
0
:
if
len
(
tracks
)
==
0
:
raise
ValueError
(
"Use None instead of an empty list to apply to all nodes."
,
f
.
__module__
,
f
.
__name__
)
for
t
in
tracks
:
if
not
(
isinstance
(
t
,
op
.
Op
)
or
issubclass
(
t
,
op
.
PureOp
)):
...
...
theano/gof/tests/test_link.py
浏览文件 @
14671ad3
...
...
@@ -113,7 +113,7 @@ class TestPerformLinker(unittest.TestCase):
def
test_input_output_same
(
self
):
x
,
y
,
z
=
inputs
()
fn
=
perform_linker
(
FunctionGraph
([
x
],
[
x
]))
.
make_function
()
assert
1.0
is
fn
(
1.0
)
assert
1.0
==
fn
(
1.0
)
def
test_input_dependency0
(
self
):
x
,
y
,
z
=
inputs
()
...
...
theano/tensor/nnet/bn.py
浏览文件 @
14671ad3
...
...
@@ -642,7 +642,7 @@ class AbstractBatchNormTrainGrad(Op):
# some inputs should be disconnected
results
=
[
g_wrt_x
,
g_wrt_dy
,
g_wrt_scale
,
g_wrt_x_mean
,
g_wrt_x_invstd
,
theano
.
gradient
.
DisconnectedType
()()]
return
[
theano
.
gradient
.
DisconnectedType
()()
if
r
is
0
else
r
return
[
theano
.
gradient
.
DisconnectedType
()()
if
(
type
(
r
)
==
int
and
r
==
0
)
else
r
for
r
in
results
]
def
connection_pattern
(
self
,
node
):
...
...
theano/tensor/nnet/tests/test_conv.py
浏览文件 @
14671ad3
...
...
@@ -95,7 +95,7 @@ class TestConv2D(utt.InferShapeTester):
# REFERENCE IMPLEMENTATION
s
=
1.
orig_image_data
=
image_data
if
border_mode
is
not
'full'
:
if
border_mode
!=
'full'
:
s
=
-
1.
out_shape2d
=
np
.
array
(
N_image_shape
[
-
2
:])
+
\
s
*
np
.
array
(
N_filter_shape
[
-
2
:])
-
s
...
...
theano/tests/test_determinism.py
浏览文件 @
14671ad3
...
...
@@ -57,7 +57,7 @@ def test_determinism_1():
updates
.
append
((
s
,
val
))
for
var
in
theano
.
gof
.
graph
.
ancestors
(
update
for
_
,
update
in
updates
):
if
var
.
name
is
not
None
and
var
.
name
is
not
'b'
:
if
var
.
name
is
not
None
and
var
.
name
!=
'b'
:
if
var
.
name
[
0
]
!=
's'
or
len
(
var
.
name
)
!=
2
:
var
.
name
=
None
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论