Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
eb484245
提交
eb484245
authored
8月 27, 2012
作者:
Ian Goodfellow
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
made FunctionGraph check for NaNs
上级
270d35fa
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
0 行删除
+6
-0
fg.py
theano/gof/fg.py
+6
-0
没有找到文件。
theano/gof/fg.py
浏览文件 @
eb484245
...
@@ -11,6 +11,7 @@ import toolbox
...
@@ -11,6 +11,7 @@ import toolbox
from
python25
import
all
from
python25
import
all
from
theano
import
config
from
theano
import
config
import
warnings
import
warnings
NaNType
=
None
class
InconsistencyError
(
Exception
):
class
InconsistencyError
(
Exception
):
...
@@ -211,6 +212,9 @@ class FunctionGraph(utils.object2):
...
@@ -211,6 +212,9 @@ class FunctionGraph(utils.object2):
### import ###
### import ###
def
__import_r__
(
self
,
variables
):
def
__import_r__
(
self
,
variables
):
global
NaNType
if
NaNType
is
None
:
from
nan_type
import
NaNType
# Imports the owners of the variables
# Imports the owners of the variables
r_owner_done
=
set
(
self
.
nodes
)
r_owner_done
=
set
(
self
.
nodes
)
for
node
in
[
r
.
owner
for
r
in
variables
if
r
.
owner
is
not
None
]:
for
node
in
[
r
.
owner
for
r
in
variables
if
r
.
owner
is
not
None
]:
...
@@ -219,6 +223,8 @@ class FunctionGraph(utils.object2):
...
@@ -219,6 +223,8 @@ class FunctionGraph(utils.object2):
self
.
__import__
(
node
)
self
.
__import__
(
node
)
for
r
in
variables
:
for
r
in
variables
:
if
r
.
owner
is
None
and
not
isinstance
(
r
,
graph
.
Constant
)
and
r
not
in
self
.
inputs
:
if
r
.
owner
is
None
and
not
isinstance
(
r
,
graph
.
Constant
)
and
r
not
in
self
.
inputs
:
if
isinstance
(
r
.
type
,
NaNType
):
raise
TypeError
(
"Computation graph contains a NaN. "
+
r
.
type
.
why_nan
)
raise
MissingInputError
(
"Undeclared input"
,
r
)
raise
MissingInputError
(
"Undeclared input"
,
r
)
if
not
getattr
(
r
,
'fgraph'
,
None
)
is
self
:
if
not
getattr
(
r
,
'fgraph'
,
None
)
is
self
:
self
.
__setup_r__
(
r
)
self
.
__setup_r__
(
r
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论