Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
cec873e3
提交
cec873e3
authored
4月 17, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
4月 18, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove use of logging with warnings
上级
fd8323fe
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
14 行删除
+11
-14
basic.py
aesara/scan/basic.py
+11
-14
没有找到文件。
aesara/scan/basic.py
浏览文件 @
cec873e3
import
logging
import
warnings
import
numpy
as
np
import
numpy
as
np
...
@@ -19,9 +19,6 @@ from aesara.tensor.type import TensorType, integer_dtypes
...
@@ -19,9 +19,6 @@ from aesara.tensor.type import TensorType, integer_dtypes
from
aesara.updates
import
OrderedUpdates
from
aesara.updates
import
OrderedUpdates
_logger
=
logging
.
getLogger
(
"aesara.scan.basic"
)
def
scan
(
def
scan
(
fn
,
fn
,
sequences
=
None
,
sequences
=
None
,
...
@@ -394,7 +391,7 @@ def scan(
...
@@ -394,7 +391,7 @@ def scan(
# ^ initial state but taps not provided
# ^ initial state but taps not provided
if
"taps"
in
outs_info
[
i
]:
if
"taps"
in
outs_info
[
i
]:
# ^ explicitly provided a None for taps
# ^ explicitly provided a None for taps
_logger
.
warning
(
warnings
.
warn
(
f
"Output {getattr(outs_info[i]['initial'], 'name', 'None')} (index {i}) has a initial "
f
"Output {getattr(outs_info[i]['initial'], 'name', 'None')} (index {i}) has a initial "
"state but taps is explicitly set to None "
,
"state but taps is explicitly set to None "
,
)
)
...
@@ -471,12 +468,12 @@ def scan(
...
@@ -471,12 +468,12 @@ def scan(
if
config
.
compute_test_value
!=
"ignore"
:
if
config
.
compute_test_value
!=
"ignore"
:
# No need to print a warning or raise an error now,
# No need to print a warning or raise an error now,
# it will be done when fn will be called.
# it will be done when fn will be called.
_logger
.
warning
(
warnings
.
warn
(
(
(
"Cannot compute test value for "
"Cannot compute test value for "
"the inner function of scan, input value "
"the inner function of scan, input value "
"missing {
}"
f
"missing {_seq_val_slice
}"
)
.
format
(
_seq_val_slice
)
)
)
)
# Add names to slices for debugging and pretty printing ..
# Add names to slices for debugging and pretty printing ..
...
@@ -600,11 +597,11 @@ def scan(
...
@@ -600,11 +597,11 @@ def scan(
arg
.
tag
.
test_value
=
get_test_value
(
actual_arg
)
arg
.
tag
.
test_value
=
get_test_value
(
actual_arg
)
except
TestValueError
:
except
TestValueError
:
if
config
.
compute_test_value
!=
"ignore"
:
if
config
.
compute_test_value
!=
"ignore"
:
_logger
.
warning
(
warnings
.
warn
(
(
(
"Cannot compute test value for the "
"Cannot compute test value for the "
"inner function of scan, test value missing: {
}"
f
"inner function of scan, test value missing: {actual_arg
}"
)
.
format
(
actual_arg
)
)
)
)
if
getattr
(
init_out
[
"initial"
],
"name"
,
None
)
is
not
None
:
if
getattr
(
init_out
[
"initial"
],
"name"
,
None
)
is
not
None
:
...
@@ -658,12 +655,12 @@ def scan(
...
@@ -658,12 +655,12 @@ def scan(
nw_slice
.
tag
.
test_value
=
get_test_value
(
_init_out_var_slice
)
nw_slice
.
tag
.
test_value
=
get_test_value
(
_init_out_var_slice
)
except
TestValueError
:
except
TestValueError
:
if
config
.
compute_test_value
!=
"ignore"
:
if
config
.
compute_test_value
!=
"ignore"
:
_logger
.
warning
(
warnings
.
warn
(
(
(
"Cannot compute test value for "
"Cannot compute test value for "
"the inner function of scan, test value "
"the inner function of scan, test value "
"missing: {
}"
f
"missing: {_init_out_var_slice
}"
)
.
format
(
_init_out_var_slice
)
)
)
)
# give it a name or debugging and pretty printing
# give it a name or debugging and pretty printing
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论