Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f175d4b8
提交
f175d4b8
authored
10月 05, 2015
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3486 from nouiz/tests
Fix daily buildbot tests
上级
4e1da6a5
704bb73a
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
32 行增加
和
11 行删除
+32
-11
debugmode.py
theano/compile/debugmode.py
+5
-2
function_module.py
theano/compile/function_module.py
+5
-2
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/compile/debugmode.py
浏览文件 @
f175d4b8
...
@@ -2403,13 +2403,15 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
...
@@ -2403,13 +2403,15 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
"""
"""
def
__init__
(
self
,
inputs
,
outputs
,
optimizer
,
mode
,
def
__init__
(
self
,
inputs
,
outputs
,
mode
,
accept_inplace
=
False
,
accept_inplace
=
False
,
function_builder
=
Function
,
function_builder
=
Function
,
profile
=
None
,
profile
=
None
,
on_unused_input
=
None
,
on_unused_input
=
None
,
fgraph
=
None
,
# If present the optimized graph. we ignore it.
output_keys
=
None
):
output_keys
=
None
):
self
.
profile
=
profile
self
.
profile
=
profile
optimizer
=
mode
.
optimizer
# Handle the case where inputs and/or outputs is a single
# Handle the case where inputs and/or outputs is a single
# Variable (not in a list)
# Variable (not in a list)
unpack_single
=
False
unpack_single
=
False
...
@@ -2523,6 +2525,7 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
...
@@ -2523,6 +2525,7 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
self
.
accept_inplace
=
accept_inplace
self
.
accept_inplace
=
accept_inplace
self
.
function_builder
=
function_builder
self
.
function_builder
=
function_builder
self
.
mode
=
mode
self
.
mode
=
mode
self
.
on_unused_input
=
on_unused_input
# Used for the pickling/copy
self
.
output_keys
=
output_keys
self
.
output_keys
=
output_keys
def
create
(
self
,
defaults
=
None
,
trustme
=
False
,
storage_map
=
None
):
def
create
(
self
,
defaults
=
None
,
trustme
=
False
,
storage_map
=
None
):
...
@@ -2744,7 +2747,7 @@ class DebugMode(Mode):
...
@@ -2744,7 +2747,7 @@ class DebugMode(Mode):
"""
"""
assert
m
is
self
assert
m
is
self
return
_Maker
(
i
,
o
,
self
.
optimizer
,
self
,
*
args
,
**
kwargs
)
return
_Maker
(
i
,
o
,
self
,
*
args
,
**
kwargs
)
def
__init__
(
self
,
def
__init__
(
self
,
optimizer
=
'fast_run'
,
optimizer
=
'fast_run'
,
...
...
theano/compile/function_module.py
浏览文件 @
f175d4b8
...
@@ -711,7 +711,10 @@ class Function(object):
...
@@ -711,7 +711,10 @@ class Function(object):
mode
=
maker
.
mode
,
profile
=
profile
,
mode
=
maker
.
mode
,
profile
=
profile
,
on_unused_input
=
maker
.
on_unused_input
,
on_unused_input
=
maker
.
on_unused_input
,
function_builder
=
maker
.
function_builder
,
function_builder
=
maker
.
function_builder
,
accept_inplace
=
maker
.
accept_inplace
# As this is an optimized graph, it
# can contain inplace. DebugMode check
# that.
accept_inplace
=
True
,
)
.
create
(
input_storage
,
)
.
create
(
input_storage
,
storage_map
=
new_storage_map
)
storage_map
=
new_storage_map
)
...
@@ -1497,7 +1500,7 @@ class FunctionMaker(object):
...
@@ -1497,7 +1500,7 @@ class FunctionMaker(object):
self
.
mode
=
mode
self
.
mode
=
mode
self
.
accept_inplace
=
accept_inplace
self
.
accept_inplace
=
accept_inplace
self
.
function_builder
=
function_builder
self
.
function_builder
=
function_builder
self
.
on_unused_input
=
on_unused_input
# Used
only for the pickling
self
.
on_unused_input
=
on_unused_input
# Used
for the pickling/copy
self
.
output_keys
=
output_keys
self
.
output_keys
=
output_keys
self
.
required
=
[(
i
.
value
is
None
)
for
i
in
self
.
inputs
]
self
.
required
=
[(
i
.
value
is
None
)
for
i
in
self
.
inputs
]
...
...
theano/d3viz/tests/test_formatting.py
浏览文件 @
f175d4b8
...
@@ -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
浏览文件 @
f175d4b8
...
@@ -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
浏览文件 @
f175d4b8
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论