Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f436939a
提交
f436939a
authored
4月 22, 2011
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add mechanism to specify behaviour of numpy.seterr.
上级
d75c6f30
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
68 行增加
和
0 行删除
+68
-0
__init__.py
theano/__init__.py
+30
-0
configdefaults.py
theano/configdefaults.py
+38
-0
没有找到文件。
theano/__init__.py
浏览文件 @
f436939a
...
@@ -81,6 +81,36 @@ import gof
...
@@ -81,6 +81,36 @@ import gof
if
config
.
device
.
startswith
(
'gpu'
)
or
config
.
init_gpu_device
.
startswith
(
'gpu'
):
if
config
.
device
.
startswith
(
'gpu'
)
or
config
.
init_gpu_device
.
startswith
(
'gpu'
):
import
theano.sandbox.cuda
import
theano.sandbox.cuda
# Use config.numpy to call numpy.seterr
import
numpy
if
config
.
numpy
.
seterr_all
==
'None'
:
_all
=
None
else
:
_all
=
config
.
numpy
.
seterr_all
if
config
.
numpy
.
seterr_divide
==
'None'
:
_divide
=
None
else
:
_divide
=
config
.
numpy
.
seterr_divide
if
config
.
numpy
.
seterr_over
==
'None'
:
_over
=
None
else
:
_over
=
config
.
numpy
.
seterr_over
if
config
.
numpy
.
seterr_under
==
'None'
:
_under
=
None
else
:
_under
=
config
.
numpy
.
seterr_under
if
config
.
numpy
.
seterr_invalid
==
'None'
:
_invalid
=
None
else
:
_invalid
=
config
.
numpy
.
seterr_invalid
numpy
.
seterr
(
all
=
_all
,
divide
=
_divide
,
over
=
_over
,
under
=
_under
,
invalid
=
_invalid
)
del
_all
,
_divide
,
_over
,
_under
,
_invalid
## import scalar_opt
## import scalar_opt
### This is defined here because it is designed to work across symbolic datatypes
### This is defined here because it is designed to work across symbolic datatypes
...
...
theano/configdefaults.py
浏览文件 @
f436939a
...
@@ -115,6 +115,44 @@ AddConfigVar('experimental.mrg',
...
@@ -115,6 +115,44 @@ AddConfigVar('experimental.mrg',
"Another random number generator that work on the gpu"
,
"Another random number generator that work on the gpu"
,
BoolParam
(
False
))
BoolParam
(
False
))
AddConfigVar
(
'numpy.seterr_all'
,
(
"Sets numpy's behaviour for floating-point errors, "
,
"see numpy.seterr. "
"'None' means not to change numpy's default, which can be "
"different for different numpy releases. "
"This flag sets the default behaviour for all kinds of floating-"
"point errors, its effect can be overriden for specific errors "
"by the following flags: seterr_divide, seterr_over, "
"seterr_under and seterr_invalid."
),
EnumStr
(
'ignore'
,
'warn'
,
'raise'
,
'call'
,
'print'
,
'log'
,
'None'
,
allow_override
=
False
))
AddConfigVar
(
'numpy.seterr_divide'
,
(
"Sets numpy's behavior for division by zero, see numpy.seterr. "
"'None' means using the default, defined by numpy.seterr_all."
),
EnumStr
(
'None'
,
'ignore'
,
'warn'
,
'raise'
,
'call'
,
'print'
,
'log'
,
allow_override
=
False
))
AddConfigVar
(
'numpy.seterr_over'
,
(
"Sets numpy's behavior for floating-point overflow, "
"see numpy.seterr. "
"'None' means using the default, defined by numpy.seterr_all."
),
EnumStr
(
'None'
,
'ignore'
,
'warn'
,
'raise'
,
'call'
,
'print'
,
'log'
,
allow_override
=
False
))
AddConfigVar
(
'numpy.seterr_under'
,
(
"Sets numpy's behavior for floating-point underflow, "
"see numpy.seterr. "
"'None' means using the default, defined by numpy.seterr_all."
),
EnumStr
(
'None'
,
'ignore'
,
'warn'
,
'raise'
,
'call'
,
'print'
,
'log'
,
allow_override
=
False
))
AddConfigVar
(
'numpy.seterr_invalid'
,
(
"Sets numpy's behavior for invalid floating-point operation, "
"see numpy.seterr. "
"'None' means using the default, defined by numpy.seterr_all."
),
EnumStr
(
'None'
,
'ignore'
,
'warn'
,
'raise'
,
'call'
,
'print'
,
'log'
,
allow_override
=
False
))
###
###
### To disable some warning about old bug that are fixed now.
### To disable some warning about old bug that are fixed now.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论