Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
177124ba
提交
177124ba
authored
6月 21, 2024
作者:
Virgile Andreani
提交者:
Ricardo Vieira
7月 03, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove OrderedDict from scan/op
上级
c7a99b60
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
4 行增加
和
5 行删除
+4
-5
op.py
pytensor/scan/op.py
+4
-5
没有找到文件。
pytensor/scan/op.py
浏览文件 @
177124ba
...
...
@@ -46,7 +46,6 @@ relies on the following elements to work properly :
import
dataclasses
import
logging
import
time
from
collections
import
OrderedDict
from
collections.abc
import
Callable
,
Iterable
from
copy
import
copy
from
itertools
import
chain
,
product
...
...
@@ -2188,7 +2187,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
# corresponding outer inputs that the Scan would use as input for
# any given iteration. For simplicity, we use iteration 0.
inner_ins_shapes
=
[]
out_equivalent
=
OrderedDict
()
out_equivalent
=
{}
# The two following blocks are commented as it cause in some
# cases extra scans in the graph. See gh-XXX for the
...
...
@@ -2469,7 +2468,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
if
(
x
in
diff_inputs
)
and
get_inp_idx
(
self_inputs
.
index
(
x
))
in
connected_inputs
]
gmp
=
OrderedDict
()
gmp
=
{}
# Required in case there is a pair of variables X and Y, with X
# used to compute Y, for both of which there is an external
...
...
@@ -2478,7 +2477,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
# it will be the sum of the external gradient signal and the
# gradient obtained by propagating Y's external gradient signal
# to X.
known_grads
=
OrderedDict
([(
k
.
copy
(),
v
)
for
(
k
,
v
)
in
known_grads
.
items
()])
known_grads
=
{
k
.
copy
():
v
for
(
k
,
v
)
in
known_grads
.
items
()}
grads
=
grad
(
cost
=
None
,
...
...
@@ -2548,7 +2547,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
dC_dXt
=
safe_new
(
dC_douts
[
idx
][
0
])
dC_dXts
.
append
(
dC_dXt
)
known_grads
=
OrderedDict
()
known_grads
=
{}
dc_dxts_idx
=
0
for
i
in
range
(
len
(
diff_outputs
)):
if
i
<
idx_nitsot_start
or
i
>=
idx_nitsot_end
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论