Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
bac35334
提交
bac35334
authored
3月 05, 2018
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support allow_remove_{inf,nan}
上级
7b648eb9
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
17 行删除
+14
-17
type.py
theano/gpuarray/type.py
+14
-17
没有找到文件。
theano/gpuarray/type.py
浏览文件 @
bac35334
...
@@ -524,23 +524,20 @@ def values_eq_approx(a, b, allow_remove_inf=False, allow_remove_nan=False,
...
@@ -524,23 +524,20 @@ def values_eq_approx(a, b, allow_remove_inf=False, allow_remove_nan=False,
if
str
(
a
.
dtype
)
in
theano
.
tensor
.
discrete_dtypes
:
if
str
(
a
.
dtype
)
in
theano
.
tensor
.
discrete_dtypes
:
return
GpuArrayType
.
values_eq
(
a
,
b
)
return
GpuArrayType
.
values_eq
(
a
,
b
)
else
:
else
:
if
allow_remove_inf
or
allow_remove_nan
:
if
not
(
allow_remove_inf
or
allow_remove_nan
):
raise
NotImplementedError
(
atol_
,
rtol_
=
theano
.
tensor
.
basic
.
_get_atol_rtol
(
a
,
b
)
"GpuArrayType.values_eq_approx() don't implemented the"
if
rtol
is
not
None
:
" allow_remove_inf and allow_remove_nan parameter"
)
rtol_
=
rtol
atol_
,
rtol_
=
theano
.
tensor
.
basic
.
_get_atol_rtol
(
a
,
b
)
if
atol
is
not
None
:
if
rtol
is
not
None
:
atol_
=
atol
rtol_
=
rtol
res
=
elemwise2
(
a
,
''
,
b
,
a
,
odtype
=
np
.
dtype
(
'bool'
),
if
atol
is
not
None
:
op_tmpl
=
"res = (fabs(a - b) <"
atol_
=
atol
"(
%(atol_)
s +
%(rtol_)
s * fabs(b)))"
%
res
=
elemwise2
(
a
,
''
,
b
,
a
,
odtype
=
np
.
dtype
(
'bool'
),
locals
())
op_tmpl
=
"res = (fabs(a - b) <"
ret
=
np
.
asarray
(
res
)
.
all
()
"(
%(atol_)
s +
%(rtol_)
s * fabs(b)))"
%
if
ret
:
locals
())
return
True
ret
=
np
.
asarray
(
res
)
.
all
()
if
ret
:
return
True
# maybe the trouble is that there are NaNs
an
=
np
.
asarray
(
a
)
an
=
np
.
asarray
(
a
)
bn
=
np
.
asarray
(
b
)
bn
=
np
.
asarray
(
b
)
return
tensor
.
TensorType
.
values_eq_approx
(
return
tensor
.
TensorType
.
values_eq_approx
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论