Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d50d1e2c
提交
d50d1e2c
authored
3月 24, 2015
作者:
AlexLamb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed deadcode. Added check that forces input keys to be strings.
上级
3f9f9cfa
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
4 行增加
和
20 行删除
+4
-20
function.py
theano/compile/function.py
+1
-1
function_module.py
theano/compile/function_module.py
+1
-6
test_dictionary_output.py
theano/tests/test_dictionary_output.py
+2
-13
没有找到文件。
theano/compile/function.py
浏览文件 @
d50d1e2c
...
@@ -193,7 +193,7 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
...
@@ -193,7 +193,7 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
output_keys
=
[]
output_keys
=
[]
outputs
=
[]
outputs
=
[]
for
pair
in
output_items_sorted
:
for
pair
in
output_items_sorted
:
assert
isinstance
(
pair
[
0
],
str
)
output_keys
.
append
(
pair
[
0
])
output_keys
.
append
(
pair
[
0
])
outputs
.
append
(
pair
[
1
])
outputs
.
append
(
pair
[
1
])
...
...
theano/compile/function_module.py
浏览文件 @
d50d1e2c
...
@@ -677,15 +677,10 @@ class Function(object):
...
@@ -677,15 +677,10 @@ class Function(object):
return
outputs
[
0
]
return
outputs
[
0
]
else
:
else
:
if
self
.
output_keys
is
not
None
:
if
self
.
output_keys
is
not
None
:
outputDict
=
{}
assert
len
(
self
.
output_keys
)
==
len
(
outputs
)
assert
len
(
self
.
output_keys
)
==
len
(
outputs
)
#for i in range(0, len(self.output_keys)):
# outputDict[self.output_keys[i]] = outputs[i]
return
dict
(
itertools
.
izip
(
self
.
output_keys
,
outputs
))
return
dict
(
itertools
.
izip
(
self
.
output_keys
,
outputs
))
return
outputs
return
outputs
...
...
theano/tests/test_dictionary_output.py
浏览文件 @
d50d1e2c
...
@@ -6,17 +6,6 @@ import sys
...
@@ -6,17 +6,6 @@ import sys
class
dictionary_output_checker
(
unittest
.
TestCase
):
class
dictionary_output_checker
(
unittest
.
TestCase
):
def
test_output_list
(
self
):
x
=
T
.
scalar
()
f
=
theano
.
function
([
x
],
outputs
=
[
x
,
x
*
2
,
x
*
3
])
outputs
=
f
(
10.0
)
assert
outputs
[
0
]
==
10.0
assert
outputs
[
1
]
==
20.0
assert
outputs
[
2
]
==
30.0
def
test_output_dictionary
(
self
):
def
test_output_dictionary
(
self
):
x
=
T
.
scalar
()
x
=
T
.
scalar
()
f
=
theano
.
function
([
x
],
outputs
=
{
'a'
:
x
,
'c'
:
x
*
2
,
f
=
theano
.
function
([
x
],
outputs
=
{
'a'
:
x
,
'c'
:
x
*
2
,
...
@@ -29,7 +18,7 @@ class dictionary_output_checker(unittest.TestCase):
...
@@ -29,7 +18,7 @@ class dictionary_output_checker(unittest.TestCase):
assert
outputs
[
'1'
]
==
40.0
assert
outputs
[
'1'
]
==
40.0
assert
outputs
[
'c'
]
==
20.0
assert
outputs
[
'c'
]
==
20.0
def
test_input_
dictionary
(
self
):
def
test_input_
named_variables
(
self
):
x
=
T
.
scalar
(
'x'
)
x
=
T
.
scalar
(
'x'
)
y
=
T
.
scalar
(
'y'
)
y
=
T
.
scalar
(
'y'
)
...
@@ -39,7 +28,7 @@ class dictionary_output_checker(unittest.TestCase):
...
@@ -39,7 +28,7 @@ class dictionary_output_checker(unittest.TestCase):
assert
f
(
2
,
y
=
4
)
==
f
(
2
,
4
)
assert
f
(
2
,
y
=
4
)
==
f
(
2
,
4
)
assert
f
(
x
=
2
,
y
=
4
)
==
f
(
2
,
4
)
assert
f
(
x
=
2
,
y
=
4
)
==
f
(
2
,
4
)
def
test_output_order
(
self
):
def
test_output_order
_sorted
(
self
):
x
=
T
.
scalar
(
'x'
)
x
=
T
.
scalar
(
'x'
)
y
=
T
.
scalar
(
'y'
)
y
=
T
.
scalar
(
'y'
)
z
=
T
.
scalar
(
'z'
)
z
=
T
.
scalar
(
'z'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论