Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7365e01e
提交
7365e01e
authored
5月 09, 2015
作者:
David Warde-Farley
提交者:
Arnaud Bergeron
6月 22, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Things that need to be lists but aren't.
上级
069a9912
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
21 行增加
和
20 行删除
+21
-20
debugmode.py
theano/compile/debugmode.py
+3
-3
test_cc.py
theano/gof/tests/test_cc.py
+1
-1
test_destroyhandler.py
theano/gof/tests/test_destroyhandler.py
+1
-1
test_graph.py
theano/gof/tests/test_graph.py
+1
-1
test_link.py
theano/gof/tests/test_link.py
+1
-1
test_op.py
theano/gof/tests/test_op.py
+1
-1
test_opt.py
theano/gof/tests/test_opt.py
+1
-1
test_toolbox.py
theano/gof/tests/test_toolbox.py
+1
-1
test_basic.py
theano/scalar/tests/test_basic.py
+4
-4
test_scan.py
theano/scan_module/tests/test_scan.py
+2
-2
test_basic.py
theano/tensor/tests/test_basic.py
+3
-2
test_extra_ops.py
theano/tensor/tests/test_extra_ops.py
+1
-1
test_merge.py
theano/tensor/tests/test_merge.py
+1
-1
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
7365e01e
...
...
@@ -2291,8 +2291,8 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
inputs
=
[
inputs
]
# Wrap them in In or Out instances if needed.
inputs
=
map
(
self
.
wrap_in
,
inputs
)
outputs
=
map
(
self
.
wrap_out
,
outputs
)
inputs
,
outputs
=
(
list
(
map
(
self
.
wrap_in
,
inputs
)),
list
(
map
(
self
.
wrap_out
,
outputs
))
)
_inputs
=
gof
.
graph
.
inputs
([
o
.
variable
for
o
in
outputs
]
+
[
i
.
update
for
i
in
inputs
if
getattr
(
i
,
'update'
,
False
)])
...
...
@@ -2320,7 +2320,7 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
optimizer
(
fgraph
)
theano
.
compile
.
function_module
.
insert_deepcopy
(
fgraph
,
inputs
,
outputs
+
additional_outputs
)
fgraph
,
inputs
,
list
(
chain
(
outputs
,
additional_outputs
))
)
finally
:
theano
.
config
.
compute_test_value
=
compute_test_value_orig
...
...
theano/gof/tests/test_cc.py
浏览文件 @
7365e01e
...
...
@@ -87,7 +87,7 @@ class MyOp(Op):
def
make_node
(
self
,
*
inputs
):
assert
len
(
inputs
)
==
self
.
nin
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
input
.
type
is
not
tdouble
:
raise
Exception
(
"Error 1"
)
...
...
theano/gof/tests/test_destroyhandler.py
浏览文件 @
7365e01e
...
...
@@ -65,7 +65,7 @@ class MyOp(Op):
def
make_node
(
self
,
*
inputs
):
assert
len
(
inputs
)
==
self
.
nin
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
not
isinstance
(
input
.
type
,
MyType
):
raise
Exception
(
"Error 1"
)
...
...
theano/gof/tests/test_graph.py
浏览文件 @
7365e01e
...
...
@@ -46,7 +46,7 @@ def MyVariable(thingy):
class
MyOp
(
Op
):
def
make_node
(
self
,
*
inputs
):
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
not
isinstance
(
input
.
type
,
MyType
):
print
(
input
,
input
.
type
,
type
(
input
),
type
(
input
.
type
))
...
...
theano/gof/tests/test_link.py
浏览文件 @
7365e01e
...
...
@@ -39,7 +39,7 @@ class MyOp(Op):
def
make_node
(
self
,
*
inputs
):
assert
len
(
inputs
)
==
self
.
nin
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
input
.
type
is
not
tdouble
:
raise
Exception
(
"Error 1"
)
...
...
theano/gof/tests/test_op.py
浏览文件 @
7365e01e
...
...
@@ -57,7 +57,7 @@ class MyType(Type):
class
MyOp
(
Op
):
def
make_node
(
self
,
*
inputs
):
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
not
isinstance
(
input
.
type
,
MyType
):
raise
Exception
(
"Error 1"
)
...
...
theano/gof/tests/test_opt.py
浏览文件 @
7365e01e
...
...
@@ -39,7 +39,7 @@ class MyOp(Op):
self
.
x
=
x
def
make_node
(
self
,
*
inputs
):
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
not
isinstance
(
input
.
type
,
MyType
):
raise
Exception
(
"Error 1"
)
...
...
theano/gof/tests/test_toolbox.py
浏览文件 @
7365e01e
...
...
@@ -39,7 +39,7 @@ class MyOp(Op):
def
make_node
(
self
,
*
inputs
):
assert
len
(
inputs
)
==
self
.
nin
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
not
isinstance
(
input
.
type
,
MyType
):
raise
Exception
(
"Error 1"
)
...
...
theano/scalar/tests/test_basic.py
浏览文件 @
7365e01e
...
...
@@ -237,7 +237,7 @@ class test_upgrade_to_float(object):
# at least float32, not float16.
unary_ops_vals
=
[
(
inv
,
list
(
range
(
-
127
,
0
)
+
range
(
1
,
127
))),
(
inv
,
list
(
range
(
-
127
,
0
)
)
+
list
(
range
(
1
,
127
))),
(
sqrt
,
list
(
range
(
0
,
128
))),
(
log
,
list
(
range
(
1
,
128
))),
(
log2
,
list
(
range
(
1
,
128
))),
...
...
@@ -262,7 +262,7 @@ class test_upgrade_to_float(object):
(
arctanh
,
[
0
])]
binary_ops_vals
=
[
(
arctan2
,
list
(
range
(
-
127
,
128
)
,
range
(
-
127
,
128
)))]
(
arctan2
,
list
(
range
(
-
127
,
128
)
),
list
(
range
(
-
127
,
128
)))]
@staticmethod
def
_test_unary
(
unary_op
,
x_range
):
...
...
@@ -306,8 +306,8 @@ class test_upgrade_to_float(object):
def
test_true_div
(
self
):
# true_div's upcast policy is not exactly "upgrade_to_float",
# so the test is a little bit different
x_range
=
range
(
-
127
,
128
)
y_range
=
range
(
-
127
,
0
)
+
range
(
1
,
127
)
x_range
=
list
(
range
(
-
127
,
128
)
)
y_range
=
list
(
range
(
-
127
,
0
))
+
list
(
range
(
1
,
127
)
)
xi
=
int8
(
'xi'
)
yi
=
int8
(
'yi'
)
...
...
theano/scan_module/tests/test_scan.py
浏览文件 @
7365e01e
...
...
@@ -1706,7 +1706,7 @@ class T_Scan(unittest.TestCase):
# Also validate that the mappings outer_inp_from_outer_out and
# outer_inp_from_inner_inp produce the correct results
scan_node
=
updates
.
values
(
)[
0
]
.
owner
scan_node
=
list
(
updates
.
values
()
)[
0
]
.
owner
result
=
scan_node
.
op
.
var_mappings
[
'outer_inp_from_outer_out'
]
expected_result
=
{
0
:
3
,
1
:
5
,
2
:
4
}
...
...
@@ -3662,7 +3662,7 @@ class T_Scan(unittest.TestCase):
n_steps
=
10
,
truncate_gradient
=-
1
,
go_backwards
=
False
)
cost
=
updates
.
values
(
)[
0
]
cost
=
list
(
updates
.
values
()
)[
0
]
g_sh
=
tensor
.
grad
(
cost
,
shared_var
)
fgrad
=
theano
.
function
([],
g_sh
)
assert
fgrad
()
==
1
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
7365e01e
...
...
@@ -846,7 +846,8 @@ _good_broadcast_div_mod_normal_float_no_complex = dict(
uinteger
=
(
randint
(
2
,
3
)
.
astype
(
"uint8"
),
randint_nonzero
(
2
,
3
)
.
astype
(
"uint8"
)),
int8
=
[
numpy
.
tile
(
numpy
.
arange
(
-
127
,
128
,
dtype
=
'int8'
),
[
254
,
1
])
.
T
,
numpy
.
tile
(
numpy
.
array
(
range
(
-
127
,
0
)
+
range
(
1
,
128
),
dtype
=
'int8'
),
numpy
.
tile
(
numpy
.
array
(
list
(
range
(
-
127
,
0
))
+
list
(
range
(
1
,
128
)),
dtype
=
'int8'
),
[
255
,
1
])],
# This empty2 doesn't work for some tests. I don't remember why
#empty2=(numpy.asarray([0]), numpy.asarray([])),
...
...
@@ -933,7 +934,7 @@ TrueDivInplaceTester = makeBroadcastTester(
_good_inv
=
dict
(
normal
=
[
5
*
rand_nonzero
((
2
,
3
))],
integers
=
[
randint_nonzero
(
2
,
3
)],
int8
=
[
numpy
.
array
(
range
(
-
127
,
0
)
+
range
(
1
,
127
),
dtype
=
'int8'
)],
int8
=
[
numpy
.
array
(
list
(
range
(
-
127
,
0
))
+
list
(
range
(
1
,
127
)
),
dtype
=
'int8'
)],
complex
=
[
randcomplex_nonzero
((
2
,
3
))],
empty
=
[
numpy
.
asarray
([],
dtype
=
config
.
floatX
)])
...
...
theano/tensor/tests/test_extra_ops.py
浏览文件 @
7365e01e
...
...
@@ -388,7 +388,7 @@ class CompressTester(utt.InferShapeTester):
class
TestRepeatOp
(
utt
.
InferShapeTester
):
def
_possible_axis
(
self
,
ndim
):
return
[
None
]
+
range
(
ndim
)
+
[
-
i
for
i
in
range
(
ndim
)]
return
[
None
]
+
list
(
range
(
ndim
)
)
+
[
-
i
for
i
in
range
(
ndim
)]
def
setUp
(
self
):
super
(
TestRepeatOp
,
self
)
.
setUp
()
...
...
theano/tensor/tests/test_merge.py
浏览文件 @
7365e01e
...
...
@@ -33,7 +33,7 @@ class MyOp(Op):
self
.
x
=
x
def
make_node
(
self
,
*
inputs
):
inputs
=
map
(
as_variable
,
inputs
)
inputs
=
list
(
map
(
as_variable
,
inputs
)
)
for
input
in
inputs
:
if
not
isinstance
(
input
.
type
,
MyType
):
raise
Exception
(
"Error 1"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论