Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3a330c5a
提交
3a330c5a
authored
7月 19, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
8月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add stubs for deprecated aesara.tensor rewriting modules
上级
ced64bfc
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
67 行增加
和
0 行删除
+67
-0
basic_opt.py
aesara/tensor/basic_opt.py
+10
-0
math_opt.py
aesara/tensor/math_opt.py
+10
-0
opt_uncanonicalize.py
aesara/tensor/opt_uncanonicalize.py
+10
-0
subtensor_opt.py
aesara/tensor/subtensor_opt.py
+10
-0
test_basic.py
tests/tensor/rewriting/test_basic.py
+6
-0
test_math.py
tests/tensor/rewriting/test_math.py
+6
-0
test_subtensor.py
tests/tensor/rewriting/test_subtensor.py
+6
-0
test_uncanonicalize.py
tests/tensor/rewriting/test_uncanonicalize.py
+9
-0
没有找到文件。
aesara/tensor/basic_opt.py
0 → 100644
浏览文件 @
3a330c5a
import
warnings
warnings
.
warn
(
"The module `aesara.tensor.basic_opt` is deprecated; use `aesara.tensor.rewriting.basic` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
aesara.tensor.rewriting.basic
import
*
# noqa: F401 E402 F403
aesara/tensor/math_opt.py
0 → 100644
浏览文件 @
3a330c5a
import
warnings
warnings
.
warn
(
"The module `aesara.tensor.math_opt` is deprecated; use `aesara.tensor.rewriting.math` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
aesara.tensor.rewriting.math
import
*
# noqa: F401 E402 F403
aesara/tensor/opt_uncanonicalize.py
0 → 100644
浏览文件 @
3a330c5a
import
warnings
warnings
.
warn
(
"The module `aesara.tensor.opt_uncanonicalize` is deprecated; use `aesara.tensor.rewriting.uncanonicalize` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
aesara.tensor.rewriting.uncanonicalize
import
*
# noqa: F401 E402 F403
aesara/tensor/subtensor_opt.py
0 → 100644
浏览文件 @
3a330c5a
import
warnings
warnings
.
warn
(
"The module `aesara.tensor.subtensor_opt` is deprecated; use `aesara.tensor.rewriting.subtensor` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
aesara.tensor.rewriting.subtensor
import
*
# noqa: F401 E402 F403
tests/tensor/rewriting/test_basic.py
浏览文件 @
3a330c5a
...
@@ -3841,3 +3841,9 @@ class TestLocalElemwiseAlloc:
...
@@ -3841,3 +3841,9 @@ class TestLocalElemwiseAlloc:
x_val
=
np
.
random
.
random
((
1
,
5
))
.
astype
(
self
.
dtype
)
x_val
=
np
.
random
.
random
((
1
,
5
))
.
astype
(
self
.
dtype
)
exp_res
=
np
.
broadcast_to
(
x_val
,
(
5
,
5
))[
...
,
None
]
+
y_val
exp_res
=
np
.
broadcast_to
(
x_val
,
(
5
,
5
))[
...
,
None
]
+
y_val
assert
np
.
array_equal
(
func
(
y_val
,
x_val
),
exp_res
)
assert
np
.
array_equal
(
func
(
y_val
,
x_val
),
exp_res
)
def
test_deprecations
():
"""Make sure we can import from deprecated modules."""
with
pytest
.
deprecated_call
():
from
aesara.tensor.basic_opt
import
register_useless
# noqa: F401 F811
tests/tensor/rewriting/test_math.py
浏览文件 @
3a330c5a
...
@@ -4633,3 +4633,9 @@ def test_local_useless_conj():
...
@@ -4633,3 +4633,9 @@ def test_local_useless_conj():
mode_with_rewrite
=
default_mode
.
including
(
"canonicalization"
,
"local_useless_conj"
)
mode_with_rewrite
=
default_mode
.
including
(
"canonicalization"
,
"local_useless_conj"
)
f
=
function
([
x
],
s
,
mode
=
mode_with_rewrite
)
f
=
function
([
x
],
s
,
mode
=
mode_with_rewrite
)
assert
any
(
node
.
op
==
_conj
for
node
in
f
.
maker
.
fgraph
.
apply_nodes
)
assert
any
(
node
.
op
==
_conj
for
node
in
f
.
maker
.
fgraph
.
apply_nodes
)
def
test_deprecations
():
"""Make sure we can import from deprecated modules."""
with
pytest
.
deprecated_call
():
from
aesara.tensor.math_opt
import
AlgebraicCanonizer
# noqa: F401 F811
tests/tensor/rewriting/test_subtensor.py
浏览文件 @
3a330c5a
...
@@ -2154,3 +2154,9 @@ def test_local_join_subtensors(axis, slices_fn, expected_nodes):
...
@@ -2154,3 +2154,9 @@ def test_local_join_subtensors(axis, slices_fn, expected_nodes):
f_val
=
np
.
concatenate
([
x_val
[
slice_val
]
for
slice_val
in
slices_val
],
axis
=
axis
)
f_val
=
np
.
concatenate
([
x_val
[
slice_val
]
for
slice_val
in
slices_val
],
axis
=
axis
)
np
.
testing
.
assert_array_equal
(
f
(
x_val
,
stop_val
),
f_val
)
np
.
testing
.
assert_array_equal
(
f
(
x_val
,
stop_val
),
f_val
)
def
test_deprecations
():
"""Make sure we can import from deprecated modules."""
with
pytest
.
deprecated_call
():
from
aesara.tensor.subtensor_opt
import
get_advsubtensor_axis
# noqa: F401 F811
tests/tensor/rewriting/test_uncanonicalize.py
浏览文件 @
3a330c5a
import
numpy
as
np
import
numpy
as
np
import
pytest
import
aesara
import
aesara
import
aesara.tensor
as
at
import
aesara.tensor
as
at
...
@@ -218,3 +219,11 @@ def test_local_dimshuffle_subtensor():
...
@@ -218,3 +219,11 @@ def test_local_dimshuffle_subtensor():
assert
x
[:,
:,
0
:
3
,
::
-
1
]
.
dimshuffle
(
0
,
2
,
3
)
.
eval
(
assert
x
[:,
:,
0
:
3
,
::
-
1
]
.
dimshuffle
(
0
,
2
,
3
)
.
eval
(
{
x
:
np
.
ones
((
5
,
1
,
6
,
7
))}
{
x
:
np
.
ones
((
5
,
1
,
6
,
7
))}
)
.
shape
==
(
5
,
3
,
7
)
)
.
shape
==
(
5
,
3
,
7
)
def
test_deprecations
():
"""Make sure we can import from deprecated modules."""
with
pytest
.
deprecated_call
():
from
aesara.tensor.opt_uncanonicalize
import
(
# noqa: F401 F811
local_reshape_dimshuffle
,
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论