Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4e0fb124
提交
4e0fb124
authored
10月 02, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests. All in FAST_COMPILE except the pycuda one
上级
3b4ccf8b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
7 行删除
+22
-7
test_formatting.py
theano/d3viz/tests/test_formatting.py
+13
-3
ordered_set.py
theano/misc/ordered_set.py
+7
-2
pycuda_example.py
theano/misc/pycuda_example.py
+2
-2
没有找到文件。
theano/d3viz/tests/test_formatting.py
浏览文件 @
4e0fb124
...
@@ -29,9 +29,16 @@ class TestPyDotFormatter(unittest.TestCase):
...
@@ -29,9 +29,16 @@ class TestPyDotFormatter(unittest.TestCase):
f
=
th
.
function
(
m
.
inputs
,
m
.
outputs
)
f
=
th
.
function
(
m
.
inputs
,
m
.
outputs
)
pdf
=
PyDotFormatter
()
pdf
=
PyDotFormatter
()
graph
=
pdf
(
f
)
graph
=
pdf
(
f
)
self
.
assertEqual
(
len
(
graph
.
get_nodes
()),
11
)
expected
=
11
if
th
.
config
.
mode
==
"FAST_COMPILE"
:
expected
=
12
self
.
assertEqual
(
len
(
graph
.
get_nodes
()),
12
)
nc
=
self
.
node_counts
(
graph
)
nc
=
self
.
node_counts
(
graph
)
assert
nc
[
'apply'
]
==
5
if
th
.
config
.
mode
==
"FAST_COMPILE"
:
assert
nc
[
'apply'
]
==
6
else
:
assert
nc
[
'apply'
]
==
5
assert
nc
[
'output'
]
==
1
assert
nc
[
'output'
]
==
1
def
test_ofg
(
self
):
def
test_ofg
(
self
):
...
@@ -43,7 +50,10 @@ class TestPyDotFormatter(unittest.TestCase):
...
@@ -43,7 +50,10 @@ class TestPyDotFormatter(unittest.TestCase):
sub_graphs
=
graph
.
get_subgraph_list
()
sub_graphs
=
graph
.
get_subgraph_list
()
assert
len
(
sub_graphs
)
==
2
assert
len
(
sub_graphs
)
==
2
ofg1
,
ofg2
=
sub_graphs
ofg1
,
ofg2
=
sub_graphs
assert
len
(
ofg1
.
get_nodes
())
==
5
if
th
.
config
.
mode
==
"FAST_COMPILE"
:
assert
len
(
ofg1
.
get_nodes
())
==
9
else
:
assert
len
(
ofg1
.
get_nodes
())
==
5
assert
len
(
ofg1
.
get_nodes
())
==
len
(
ofg2
.
get_nodes
())
assert
len
(
ofg1
.
get_nodes
())
==
len
(
ofg2
.
get_nodes
())
def
test_ofg_nested
(
self
):
def
test_ofg_nested
(
self
):
...
...
theano/misc/ordered_set.py
浏览文件 @
4e0fb124
...
@@ -15,8 +15,13 @@ def check_deterministic(iterable):
...
@@ -15,8 +15,13 @@ def check_deterministic(iterable):
# So I must use an assert here. In the long term we should fix the rest of
# So I must use an assert here. In the long term we should fix the rest of
# theano to use exceptions correctly, so that this can be a TypeError.
# theano to use exceptions correctly, so that this can be a TypeError.
if
iterable
is
not
None
:
if
iterable
is
not
None
:
assert
isinstance
(
iterable
,
(
if
not
isinstance
(
iterable
,
(
list
,
tuple
,
OrderedSet
,
types
.
GeneratorType
,
string_types
))
list
,
tuple
,
OrderedSet
,
types
.
GeneratorType
,
string_types
)):
if
len
(
iterable
)
>
1
:
# We need to accept length 1 size to allow unpickle in tests.
raise
AssertionError
(
"Get an not ordered iterable when one was expected"
)
# Copyright (C) 2009 Raymond Hettinger
# Copyright (C) 2009 Raymond Hettinger
# Permission is hereby granted, free of charge, to any person obtaining a
# Permission is hereby granted, free of charge, to any person obtaining a
...
...
theano/misc/pycuda_example.py
浏览文件 @
4e0fb124
...
@@ -287,8 +287,8 @@ class PycudaElemwiseSourceModuleMakeThunkOp(Op):
...
@@ -287,8 +287,8 @@ class PycudaElemwiseSourceModuleMakeThunkOp(Op):
# As we have a dict in props, we need to implement __hash__
# As we have a dict in props, we need to implement __hash__
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
(
type
(
self
),
hash
(
self
.
scalar_op
),
return
hash
(
(
type
(
self
),
hash
(
self
.
scalar_op
),
hash_from_dict
(
self
.
inplace_pattern
))
hash_from_dict
(
self
.
inplace_pattern
))
)
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
name
is
None
:
if
self
.
name
is
None
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论