Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
54645174
提交
54645174
authored
7月 31, 2017
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use python any where we aren't working with ndarrays.
上级
1a4fec6e
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
3 行增加
和
4 行删除
+3
-4
function.py
theano/compile/function.py
+1
-2
function_module.py
theano/compile/function_module.py
+1
-1
scan_utils.py
theano/scan_module/scan_utils.py
+1
-1
没有找到文件。
theano/compile/function.py
浏览文件 @
54645174
...
@@ -13,7 +13,6 @@ from six import string_types
...
@@ -13,7 +13,6 @@ from six import string_types
from
theano.compile.io
import
In
from
theano.compile.io
import
In
from
theano.compile.function_module
import
orig_function
from
theano.compile.function_module
import
orig_function
from
theano.compile.pfunc
import
pfunc
from
theano.compile.pfunc
import
pfunc
import
numpy
as
np
import
warnings
import
warnings
from
theano
import
compat
from
theano
import
compat
...
@@ -286,7 +285,7 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
...
@@ -286,7 +285,7 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
"input."
)
"input."
)
# compute some features of the arguments:
# compute some features of the arguments:
uses_tuple
=
np
.
any
([
isinstance
(
i
,
(
list
,
tuple
))
for
i
in
inputs
])
uses_tuple
=
any
([
isinstance
(
i
,
(
list
,
tuple
))
for
i
in
inputs
])
uses_updates
=
bool
(
updates
)
uses_updates
=
bool
(
updates
)
uses_givens
=
bool
(
givens
)
uses_givens
=
bool
(
givens
)
...
...
theano/compile/function_module.py
浏览文件 @
54645174
...
@@ -836,7 +836,7 @@ class Function(object):
...
@@ -836,7 +836,7 @@ class Function(object):
in
args_share_memory
[
j
]],
in
args_share_memory
[
j
]],
[
self
.
input_storage
[
k
]
.
storage
[
0
]
for
k
[
self
.
input_storage
[
k
]
.
storage
[
0
]
for
k
in
args_share_memory
[
j
]])
in
args_share_memory
[
j
]])
if
np
.
any
([(
var
.
type
is
i_var
.
type
and
if
any
([(
var
.
type
is
i_var
.
type
and
var
.
type
.
may_share_memory
(
val
,
i_val
))
var
.
type
.
may_share_memory
(
val
,
i_val
))
for
(
var
,
val
)
in
group_j
]):
for
(
var
,
val
)
in
group_j
]):
...
...
theano/scan_module/scan_utils.py
浏览文件 @
54645174
...
@@ -948,7 +948,7 @@ def scan_can_remove_outs(op, out_idxs):
...
@@ -948,7 +948,7 @@ def scan_can_remove_outs(op, out_idxs):
added
=
False
added
=
False
for
pos
,
idx
in
enumerate
(
out_idxs
):
for
pos
,
idx
in
enumerate
(
out_idxs
):
if
(
out_idxs_mask
[
pos
]
and
if
(
out_idxs_mask
[
pos
]
and
np
.
any
([
x
in
required_inputs
for
x
in
out_ins
[
idx
]])):
any
([
x
in
required_inputs
for
x
in
out_ins
[
idx
]])):
# This output is required ..
# This output is required ..
out_idxs_mask
[
pos
]
=
0
out_idxs_mask
[
pos
]
=
0
required_inputs
+=
gof
.
graph
.
inputs
([
op
.
outputs
[
idx
]])
required_inputs
+=
gof
.
graph
.
inputs
([
op
.
outputs
[
idx
]])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论