Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3b7aa75e
提交
3b7aa75e
authored
1月 26, 2017
作者:
Benjamin Scellier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix pep8 errors
上级
74661b8b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
17 行增加
和
17 行删除
+17
-17
debugmode.py
theano/compile/debugmode.py
+1
-1
function_module.py
theano/compile/function_module.py
+2
-2
ops.py
theano/compile/ops.py
+1
-1
test_builders.py
theano/compile/tests/test_builders.py
+1
-1
test_debugmode.py
theano/compile/tests/test_debugmode.py
+1
-1
test_pfunc.py
theano/compile/tests/test_pfunc.py
+11
-11
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
3b7aa75e
...
...
@@ -287,7 +287,7 @@ class BadOptimization(DebugModeError):
# nv == ov == 0
reldiff
=
(
abs_diff
/
np
.
maximum
(
np
.
absolute
(
nv
)
+
np
.
absolute
(
ov
),
1e-8
))
1e-8
))
print
(
" Max Rel Diff: "
,
np
.
max
(
reldiff
),
file
=
ssio
)
print
(
" Mean Rel Diff: "
,
np
.
mean
(
reldiff
),
file
=
ssio
)
print
(
" Median Rel Diff: "
,
np
.
median
(
reldiff
),
file
=
ssio
)
...
...
theano/compile/function_module.py
浏览文件 @
3b7aa75e
...
...
@@ -830,8 +830,8 @@ class Function(object):
[
self
.
input_storage
[
k
]
.
storage
[
0
]
for
k
in
args_share_memory
[
j
]])
if
np
.
any
([(
var
.
type
is
i_var
.
type
and
var
.
type
.
may_share_memory
(
val
,
i_val
))
for
(
var
,
val
)
in
group_j
]):
var
.
type
.
may_share_memory
(
val
,
i_val
))
for
(
var
,
val
)
in
group_j
]):
is_aliased
=
True
args_share_memory
[
j
]
.
append
(
i
)
...
...
theano/compile/ops.py
浏览文件 @
3b7aa75e
...
...
@@ -836,7 +836,7 @@ class SpecifyShape(gof.Op):
out
,
=
out_
assert
x
.
ndim
==
shape
.
size
assert
np
.
all
(
x
.
shape
==
shape
),
(
"got shape"
,
x
.
shape
,
"expected"
,
shape
)
"expected"
,
shape
)
out
[
0
]
=
x
def
infer_shape
(
self
,
node
,
shapes
):
...
...
theano/compile/tests/test_builders.py
浏览文件 @
3b7aa75e
...
...
@@ -108,7 +108,7 @@ class T_OpFromGraph(unittest_tools.InferShapeTester):
f
=
f
-
T
.
grad
(
T
.
sum
(
f
),
s
)
fn
=
function
([
x
,
y
,
z
],
f
)
assert
np
.
allclose
(
15.0
+
s
.
get_value
(),
fn
(
xv
,
yv
,
zv
))
fn
(
xv
,
yv
,
zv
))
def
test_connection_pattern
(
self
):
# Basic case
...
...
theano/compile/tests/test_debugmode.py
浏览文件 @
3b7aa75e
...
...
@@ -579,7 +579,7 @@ class Test_check_isfinite(unittest.TestCase):
'DEBUG_MODE'
]
.
check_isfinite
=
False
# insert several Inf
f
(
np
.
asarray
(
np
.
asarray
([
1.0
,
1.0
,
1.0
])
/
0
,
dtype
=
config
.
floatX
))
dtype
=
config
.
floatX
))
def
test_check_isfinite_disabled
(
self
):
x
=
theano
.
tensor
.
dvector
()
...
...
theano/compile/tests/test_pfunc.py
浏览文件 @
3b7aa75e
...
...
@@ -701,7 +701,7 @@ class Test_aliasing_rules(unittest.TestCase):
# rule #2 reading back from theano-managed memory
assert
not
np
.
may_share_memory
(
A
.
get_value
(
borrow
=
False
),
data_of
(
A
))
data_of
(
A
))
def
test_sparse_input_aliasing_affecting_inplace_operations
(
self
):
##
...
...
@@ -773,20 +773,20 @@ class Test_aliasing_rules(unittest.TestCase):
# Compute bogus values
v
=
np
.
asarray
([
1
,
2
,
3
,
4
,
5
],
dtype
=
'float64'
)
m
=
np
.
asarray
([[
1
,
0
,
0
,
0
,
0
],
[
0
,
1
,
0
,
0
,
0
],
[
0
,
0
,
1
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
],
[
0
,
0
,
0
,
0
,
1
]],
dtype
=
'float64'
)
[
0
,
1
,
0
,
0
,
0
],
[
0
,
0
,
1
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
],
[
0
,
0
,
0
,
0
,
1
]],
dtype
=
'float64'
)
bogus_vals
=
f
(
v
,
v
,
m
,
m
)
# Since we used inplace operation v and m may be corrupted
# so we need to recreate them
v
=
np
.
asarray
([
1
,
2
,
3
,
4
,
5
],
dtype
=
'float64'
)
m
=
np
.
asarray
([[
1
,
0
,
0
,
0
,
0
],
[
0
,
1
,
0
,
0
,
0
],
[
0
,
0
,
1
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
],
[
0
,
0
,
0
,
0
,
1
]],
dtype
=
'float64'
)
[
0
,
1
,
0
,
0
,
0
],
[
0
,
0
,
1
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
],
[
0
,
0
,
0
,
0
,
1
]],
dtype
=
'float64'
)
m_copy
=
m
.
copy
()
v_copy
=
v
.
copy
()
vals
=
f
(
v
,
v_copy
,
m
,
m_copy
)
...
...
@@ -824,14 +824,14 @@ class Test_aliasing_rules(unittest.TestCase):
# Compute bogus values
v
=
np
.
asarray
([
1
,
2
,
3
,
4
,
5
],
dtype
=
'float64'
)
m
=
np
.
asarray
([[
1
,
0
],
[
0
,
1
]],
dtype
=
'float64'
)
[
0
,
1
]],
dtype
=
'float64'
)
bogus_vals
=
f
(
v
[:
2
],
v
[
1
:
3
],
v
[
2
:
4
],
m
,
m
,
m
)
# Since we used inplace operation v and m may be corrupted
# so we need to recreate them
v
=
np
.
asarray
([
1
,
2
,
3
,
4
,
5
],
dtype
=
'float64'
)
m
=
np
.
asarray
([[
1
,
0
],
[
0
,
1
]],
dtype
=
'float64'
)
[
0
,
1
]],
dtype
=
'float64'
)
m_copy1
=
m
.
copy
()
v_copy1
=
v
.
copy
()
m_copy2
=
m
.
copy
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论