Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
31948828
提交
31948828
authored
1月 24, 2017
作者:
Frédéric Bastien
提交者:
GitHub
1月 24, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5437 from nouiz/round
Change default of round() to be as NumPy and warn about it.
上级
f33a3315
45a1ad4a
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
22 行增加
和
6 行删除
+22
-6
config.txt
doc/library/config.txt
+1
-1
configdefaults.py
theano/configdefaults.py
+8
-1
basic.py
theano/tensor/basic.py
+12
-3
var.py
theano/tensor/var.py
+1
-1
没有找到文件。
doc/library/config.txt
浏览文件 @
31948828
...
@@ -585,7 +585,7 @@ import theano and print the config variable, as in:
...
@@ -585,7 +585,7 @@ import theano and print the config variable, as in:
.. attribute:: config.warn.ignore_bug_before
.. attribute:: config.warn.ignore_bug_before
String value: ``'None'``, ``'all'``, ``'0.3'``, ``'0.4'``, ``'0.4.1'``, ``'0.5'``,
String value: ``'None'``, ``'all'``, ``'0.3'``, ``'0.4'``, ``'0.4.1'``, ``'0.5'``,
``'0.6'``, ``'0.7'``, ``'0.8'``, ``'0.8.1'``, ``'0.8.2'``
``'0.6'``, ``'0.7'``, ``'0.8'``, ``'0.8.1'``, ``'0.8.2'``
, ``'0.9'``
Default: ``'0.7'``
Default: ``'0.7'``
...
...
theano/configdefaults.py
浏览文件 @
31948828
...
@@ -692,7 +692,7 @@ AddConfigVar('warn.ignore_bug_before',
...
@@ -692,7 +692,7 @@ AddConfigVar('warn.ignore_bug_before',
"Warning for specific bugs can be configured with specific "
"Warning for specific bugs can be configured with specific "
"[warn] flags."
),
"[warn] flags."
),
EnumStr
(
'0.7'
,
'None'
,
'all'
,
'0.3'
,
'0.4'
,
'0.4.1'
,
'0.5'
,
'0.6'
,
EnumStr
(
'0.7'
,
'None'
,
'all'
,
'0.3'
,
'0.4'
,
'0.4.1'
,
'0.5'
,
'0.6'
,
'0.7'
,
'0.8'
,
'0.8.1'
,
'0.8.2'
,
'0.7'
,
'0.8'
,
'0.8.1'
,
'0.8.2'
,
'0.9'
,
allow_override
=
False
),
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
...
@@ -796,6 +796,13 @@ AddConfigVar('warn.inc_set_subtensor1',
...
@@ -796,6 +796,13 @@ AddConfigVar('warn.inc_set_subtensor1',
BoolParam
(
warn_default
(
'0.7'
)),
BoolParam
(
warn_default
(
'0.7'
)),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'warn.round'
,
"Round changed its default from Seed to use for randomized unit tests. "
"Special value 'random' means using a seed of None."
,
BoolParam
(
warn_default
(
'0.9'
)),
in_c_key
=
False
)
AddConfigVar
(
AddConfigVar
(
'compute_test_value'
,
'compute_test_value'
,
(
"If 'True', Theano will run each op at graph build time, using "
(
"If 'True', Theano will run each op at graph build time, using "
...
...
theano/tensor/basic.py
浏览文件 @
31948828
...
@@ -2128,14 +2128,23 @@ def trunc(a):
...
@@ -2128,14 +2128,23 @@ def trunc(a):
@constructor
@constructor
def
iround
(
a
,
mode
=
"half_away_from_zero"
):
def
iround
(
a
,
mode
=
None
):
"""cast(round(a,mode),'int64')"""
"""cast(round(a,mode),'int64')"""
return
cast
(
round
(
a
,
mode
),
'int64'
)
return
cast
(
round
(
a
,
mode
),
'int64'
)
@constructor
@constructor
def
round
(
a
,
mode
=
"half_away_from_zero"
):
def
round
(
a
,
mode
=
None
):
"""round_mode(a) with mode in [half_away_from_zero, half_to_even]"""
"""round_mode(a) with mode in [half_away_from_zero, half_to_even].
Default to half_to_even."""
if
mode
is
None
:
mode
=
"half_to_even"
if
config
.
warn
.
round
:
warnings
.
warn
(
"theano.tensor.round() changed its default from"
" `half_away_from_zero` to `half_to_even` to have"
" the same default as NumPy. Use the Theano flag"
" `warn.round=False` to disable this warning."
)
if
mode
==
"half_away_from_zero"
:
if
mode
==
"half_away_from_zero"
:
return
round_half_away_from_zero
(
a
)
return
round_half_away_from_zero
(
a
)
elif
mode
==
"half_to_even"
:
elif
mode
==
"half_to_even"
:
...
...
theano/tensor/var.py
浏览文件 @
31948828
...
@@ -711,7 +711,7 @@ class _tensor_py_operators(object):
...
@@ -711,7 +711,7 @@ class _tensor_py_operators(object):
"""See `theano.tensor.repeat`."""
"""See `theano.tensor.repeat`."""
return
theano
.
tensor
.
extra_ops
.
repeat
(
self
,
repeats
,
axis
)
return
theano
.
tensor
.
extra_ops
.
repeat
(
self
,
repeats
,
axis
)
def
round
(
self
,
mode
=
"half_away_from_zero"
):
def
round
(
self
,
mode
=
None
):
"""See `theano.tensor.round`."""
"""See `theano.tensor.round`."""
return
theano
.
tensor
.
basic
.
round
(
self
,
mode
)
return
theano
.
tensor
.
basic
.
round
(
self
,
mode
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论