Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
cc364dd9
提交
cc364dd9
authored
12月 13, 2022
作者:
Maxim Kochurov
提交者:
Maxim Kochurov
12月 16, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove more deprecated modules
上级
e0589482
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
0 行增加
和
121 行删除
+0
-121
basic_opt.py
pytensor/tensor/basic_opt.py
+0
-13
math_opt.py
pytensor/tensor/math_opt.py
+0
-10
opt_uncanonicalize.py
pytensor/tensor/opt_uncanonicalize.py
+0
-10
subtensor_opt.py
pytensor/tensor/subtensor_opt.py
+0
-10
test_db.py
tests/graph/rewriting/test_db.py
+0
-16
test_kanren.py
tests/graph/rewriting/test_kanren.py
+0
-6
test_unify.py
tests/graph/rewriting/test_unify.py
+0
-6
test_utils.py
tests/graph/rewriting/test_utils.py
+0
-18
test_basic.py
tests/tensor/rewriting/test_basic.py
+0
-9
test_math.py
tests/tensor/rewriting/test_math.py
+0
-6
test_subtensor.py
tests/tensor/rewriting/test_subtensor.py
+0
-8
test_uncanonicalize.py
tests/tensor/rewriting/test_uncanonicalize.py
+0
-9
没有找到文件。
pytensor/tensor/basic_opt.py
deleted
100644 → 0
浏览文件 @
e0589482
import
warnings
warnings
.
warn
(
"The module `pytensor.tensor.basic_opt` is deprecated; use `pytensor.tensor.rewriting.basic` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
pytensor.tensor.rewriting.basic
import
*
# noqa: F401 E402 F403
from
pytensor.tensor.rewriting.elemwise
import
*
# noqa: F401 E402 F403
from
pytensor.tensor.rewriting.extra_ops
import
*
# noqa: F401 E402 F403
from
pytensor.tensor.rewriting.shape
import
*
# noqa: F401 E402 F403
pytensor/tensor/math_opt.py
deleted
100644 → 0
浏览文件 @
e0589482
import
warnings
warnings
.
warn
(
"The module `pytensor.tensor.math_opt` is deprecated; use `pytensor.tensor.rewriting.math` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
pytensor.tensor.rewriting.math
import
*
# noqa: F401 E402 F403
pytensor/tensor/opt_uncanonicalize.py
deleted
100644 → 0
浏览文件 @
e0589482
import
warnings
warnings
.
warn
(
"The module `pytensor.tensor.opt_uncanonicalize` is deprecated; use `pytensor.tensor.rewriting.uncanonicalize` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
pytensor.tensor.rewriting.uncanonicalize
import
*
# noqa: F401 E402 F403
pytensor/tensor/subtensor_opt.py
deleted
100644 → 0
浏览文件 @
e0589482
import
warnings
warnings
.
warn
(
"The module `pytensor.tensor.subtensor_opt` is deprecated; use `pytensor.tensor.rewriting.subtensor` instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
from
pytensor.tensor.rewriting.subtensor
import
*
# noqa: F401 E402 F403
tests/graph/rewriting/test_db.py
浏览文件 @
cc364dd9
import
sys
import
pytest
import
pytest
from
pytensor.graph.rewriting.basic
import
GraphRewriter
,
SequentialGraphRewriter
from
pytensor.graph.rewriting.basic
import
GraphRewriter
,
SequentialGraphRewriter
...
@@ -86,17 +84,3 @@ class TestDB:
...
@@ -86,17 +84,3 @@ class TestDB:
def
test_ProxyDB
(
self
):
def
test_ProxyDB
(
self
):
with
pytest
.
raises
(
TypeError
,
match
=
r"`db` must be.*"
):
with
pytest
.
raises
(
TypeError
,
match
=
r"`db` must be.*"
):
ProxyDB
(
object
())
ProxyDB
(
object
())
def
test_deprecations
():
"""Make sure we can import deprecated classes from current and deprecated modules."""
with
pytest
.
deprecated_call
():
from
pytensor.graph.rewriting.db
import
OptimizationDatabase
# noqa: F401 F811
with
pytest
.
deprecated_call
():
from
pytensor.graph.optdb
import
OptimizationDatabase
# noqa: F401 F811
del
sys
.
modules
[
"pytensor.graph.optdb"
]
with
pytest
.
deprecated_call
():
from
pytensor.graph.optdb
import
RewriteDatabase
# noqa: F401
tests/graph/rewriting/test_kanren.py
浏览文件 @
cc364dd9
...
@@ -165,9 +165,3 @@ def test_KanrenRelationSub_dot():
...
@@ -165,9 +165,3 @@ def test_KanrenRelationSub_dot():
assert
expr_opt
.
owner
.
inputs
[
1
]
.
owner
.
op
==
at
.
add
assert
expr_opt
.
owner
.
inputs
[
1
]
.
owner
.
op
==
at
.
add
assert
isinstance
(
expr_opt
.
owner
.
inputs
[
1
]
.
owner
.
inputs
[
0
]
.
owner
.
op
,
Dot
)
assert
isinstance
(
expr_opt
.
owner
.
inputs
[
1
]
.
owner
.
inputs
[
0
]
.
owner
.
op
,
Dot
)
assert
isinstance
(
expr_opt
.
owner
.
inputs
[
1
]
.
owner
.
inputs
[
1
]
.
owner
.
op
,
Dot
)
assert
isinstance
(
expr_opt
.
owner
.
inputs
[
1
]
.
owner
.
inputs
[
1
]
.
owner
.
op
,
Dot
)
def
test_deprecations
():
"""Make sure we can import deprecated classes from current and deprecated modules."""
with
pytest
.
deprecated_call
():
from
pytensor.graph.kanren
import
KanrenRelationSub
# noqa: F401 F811
tests/graph/rewriting/test_unify.py
浏览文件 @
cc364dd9
...
@@ -350,9 +350,3 @@ def test_convert_strs_to_vars():
...
@@ -350,9 +350,3 @@ def test_convert_strs_to_vars():
res
=
convert_strs_to_vars
((
val
,))
res
=
convert_strs_to_vars
((
val
,))
assert
isinstance
(
res
[
0
],
Constant
)
assert
isinstance
(
res
[
0
],
Constant
)
assert
np
.
array_equal
(
res
[
0
]
.
data
,
val
)
assert
np
.
array_equal
(
res
[
0
]
.
data
,
val
)
def
test_deprecations
():
"""Make sure we can import deprecated classes from current and deprecated modules."""
with
pytest
.
deprecated_call
():
from
pytensor.graph.unify
import
eval_if_etuple
# noqa: F401 F811
tests/graph/rewriting/test_utils.py
浏览文件 @
cc364dd9
import
sys
import
pytest
from
pytensor.graph.fg
import
FunctionGraph
from
pytensor.graph.fg
import
FunctionGraph
from
pytensor.graph.rewriting.basic
import
graph_rewriter
from
pytensor.graph.rewriting.basic
import
graph_rewriter
from
pytensor.graph.rewriting.utils
import
is_same_graph
,
rewrite_graph
from
pytensor.graph.rewriting.utils
import
is_same_graph
,
rewrite_graph
...
@@ -160,17 +156,3 @@ def test_rewrite_graph():
...
@@ -160,17 +156,3 @@ def test_rewrite_graph():
)
)
assert
x_rewritten
.
outputs
[
0
]
is
y
assert
x_rewritten
.
outputs
[
0
]
is
y
def
test_deprecations
():
"""Make sure we can import deprecated classes from current and deprecated modules."""
with
pytest
.
deprecated_call
():
from
pytensor.graph.rewriting.utils
import
optimize_graph
# noqa: F401 F811
with
pytest
.
deprecated_call
():
from
pytensor.graph.opt_utils
import
optimize_graph
# noqa: F401 F811
del
sys
.
modules
[
"pytensor.graph.opt_utils"
]
with
pytest
.
deprecated_call
():
from
pytensor.graph.opt_utils
import
rewrite_graph
# noqa: F401
tests/tensor/rewriting/test_basic.py
浏览文件 @
cc364dd9
...
@@ -1884,12 +1884,3 @@ class TestLocalElemwiseAlloc:
...
@@ -1884,12 +1884,3 @@ 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
pytensor.tensor.basic_opt
import
register_useless
# noqa: F401 F811
with
pytest
.
deprecated_call
():
from
pytensor.tensor.rewriting.basic
import
ShapeFeature
# noqa: F401
tests/tensor/rewriting/test_math.py
浏览文件 @
cc364dd9
...
@@ -4625,12 +4625,6 @@ def test_local_useless_conj():
...
@@ -4625,12 +4625,6 @@ def test_local_useless_conj():
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
pytensor.tensor.math_opt
import
AlgebraicCanonizer
# noqa: F401 F811
def
test_local_sub_neg_to_add
():
def
test_local_sub_neg_to_add
():
x
=
scalar
(
"x"
)
x
=
scalar
(
"x"
)
y
=
vector
(
"y"
)
y
=
vector
(
"y"
)
...
...
tests/tensor/rewriting/test_subtensor.py
浏览文件 @
cc364dd9
...
@@ -2166,14 +2166,6 @@ def test_local_join_subtensors(axis, slices_fn, expected_nodes):
...
@@ -2166,14 +2166,6 @@ def test_local_join_subtensors(axis, slices_fn, expected_nodes):
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
pytensor.tensor.subtensor_opt
import
(
# noqa: F401 F811
get_advsubtensor_axis
,
)
def
test_local_uint_constant_indices
():
def
test_local_uint_constant_indices
():
mode
=
get_default_mode
()
.
including
(
"specialize"
,
"local_uint_constant_indices"
)
mode
=
get_default_mode
()
.
including
(
"specialize"
,
"local_uint_constant_indices"
)
rng
=
np
.
random
.
default_rng
(
20900
)
rng
=
np
.
random
.
default_rng
(
20900
)
...
...
tests/tensor/rewriting/test_uncanonicalize.py
浏览文件 @
cc364dd9
import
numpy
as
np
import
numpy
as
np
import
pytest
import
pytensor
import
pytensor
import
pytensor.tensor
as
at
import
pytensor.tensor
as
at
...
@@ -219,11 +218,3 @@ def test_local_dimshuffle_subtensor():
...
@@ -219,11 +218,3 @@ 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
pytensor.tensor.opt_uncanonicalize
import
(
# noqa: F401 F811
local_reshape_dimshuffle
,
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论