Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ec117322
提交
ec117322
authored
1月 16, 2026
作者:
Ricardo Vieira
提交者:
Ricardo Vieira
1月 19, 2026
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix exclude tag cxx -> cxx_only
上级
6d4e3491
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
9 行增加
和
17 行删除
+9
-17
basic.py
pytensor/link/basic.py
+1
-1
linker.py
pytensor/link/jax/linker.py
+1
-1
linker.py
pytensor/link/numba/linker.py
+1
-1
vm.py
pytensor/link/vm.py
+1
-1
blas_c.py
pytensor/tensor/rewriting/blas_c.py
+1
-0
test_rewriting.py
tests/sparse/test_rewriting.py
+4
-13
没有找到文件。
pytensor/link/basic.py
浏览文件 @
ec117322
...
@@ -284,7 +284,7 @@ class PerformLinker(LocalLinker):
...
@@ -284,7 +284,7 @@ class PerformLinker(LocalLinker):
"""
"""
required_rewrites
:
tuple
[
str
,
...
]
=
(
"minimum_compile"
,
"py_only"
)
required_rewrites
:
tuple
[
str
,
...
]
=
(
"minimum_compile"
,
"py_only"
)
incompatible_rewrites
:
tuple
[
str
,
...
]
=
(
"cxx"
,)
incompatible_rewrites
:
tuple
[
str
,
...
]
=
(
"cxx
_only
"
,)
def
__init__
(
def
__init__
(
self
,
allow_gc
:
bool
|
None
=
None
,
schedule
:
Callable
|
None
=
None
self
,
allow_gc
:
bool
|
None
=
None
,
schedule
:
Callable
|
None
=
None
...
...
pytensor/link/jax/linker.py
浏览文件 @
ec117322
...
@@ -14,7 +14,7 @@ class JAXLinker(JITLinker):
...
@@ -14,7 +14,7 @@ class JAXLinker(JITLinker):
"jax"
,
"jax"
,
)
# TODO: Distinguish between optional "jax" and "minimum_compile_jax"
)
# TODO: Distinguish between optional "jax" and "minimum_compile_jax"
incompatible_rewrites
=
(
incompatible_rewrites
=
(
"cxx"
,
"cxx
_only
"
,
"BlasOpt"
,
"BlasOpt"
,
"local_careduce_fusion"
,
"local_careduce_fusion"
,
"scan_save_mem_prealloc"
,
"scan_save_mem_prealloc"
,
...
...
pytensor/link/numba/linker.py
浏览文件 @
ec117322
...
@@ -7,7 +7,7 @@ class NumbaLinker(JITLinker):
...
@@ -7,7 +7,7 @@ class NumbaLinker(JITLinker):
"numba"
,
"numba"
,
)
# TODO: Distinguish between optional "numba" and "minimum_compile_numba"
)
# TODO: Distinguish between optional "numba" and "minimum_compile_numba"
incompatible_rewrites
=
(
incompatible_rewrites
=
(
"cxx"
,
"cxx
_only
"
,
"BlasOpt"
,
"BlasOpt"
,
"local_careduce_fusion"
,
"local_careduce_fusion"
,
"scan_save_mem_prealloc"
,
"scan_save_mem_prealloc"
,
...
...
pytensor/link/vm.py
浏览文件 @
ec117322
...
@@ -840,7 +840,7 @@ class VMLinker(LocalLinker):
...
@@ -840,7 +840,7 @@ class VMLinker(LocalLinker):
c_thunks
=
bool
(
config
.
cxx
)
c_thunks
=
bool
(
config
.
cxx
)
if
not
c_thunks
:
if
not
c_thunks
:
self
.
required_rewrites
:
tuple
[
str
,
...
]
=
(
"minimum_compile"
,
"py_only"
)
self
.
required_rewrites
:
tuple
[
str
,
...
]
=
(
"minimum_compile"
,
"py_only"
)
self
.
incompatible_rewrites
:
tuple
[
str
,
...
]
=
(
"cxx"
,)
self
.
incompatible_rewrites
:
tuple
[
str
,
...
]
=
(
"cxx
_only
"
,)
self
.
c_thunks
=
c_thunks
self
.
c_thunks
=
c_thunks
self
.
allow_partial_eval
=
allow_partial_eval
self
.
allow_partial_eval
=
allow_partial_eval
self
.
updated_vars
=
{}
self
.
updated_vars
=
{}
...
...
pytensor/tensor/rewriting/blas_c.py
浏览文件 @
ec117322
...
@@ -68,5 +68,6 @@ optdb.register(
...
@@ -68,5 +68,6 @@ optdb.register(
"fast_run"
,
"fast_run"
,
"inplace"
,
"inplace"
,
"c_blas"
,
"c_blas"
,
"cxx_only"
,
position
=
70.0
,
position
=
70.0
,
)
)
tests/sparse/test_rewriting.py
浏览文件 @
ec117322
...
@@ -69,13 +69,10 @@ def test_local_csm_grad_c():
...
@@ -69,13 +69,10 @@ def test_local_csm_grad_c():
not
pytensor
.
config
.
cxx
,
reason
=
"G++ not available, so we need to skip this test."
not
pytensor
.
config
.
cxx
,
reason
=
"G++ not available, so we need to skip this test."
)
)
def
test_local_mul_s_d
():
def
test_local_mul_s_d
():
mode
=
get_default_mode
()
mode
=
mode
.
including
(
"specialize"
,
"local_mul_s_d"
)
for
sp_format
in
sparse
.
sparse_formats
:
for
sp_format
in
sparse
.
sparse_formats
:
inputs
=
[
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
matrix
()]
inputs
=
[
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
matrix
()]
f
=
pytensor
.
function
(
inputs
,
smath
.
mul_s_d
(
*
inputs
),
mode
=
mode
)
f
=
pytensor
.
function
(
inputs
,
smath
.
mul_s_d
(
*
inputs
),
mode
=
"CVM"
)
assert
not
any
(
assert
not
any
(
isinstance
(
node
.
op
,
smath
.
MulSD
)
for
node
in
f
.
maker
.
fgraph
.
toposort
()
isinstance
(
node
.
op
,
smath
.
MulSD
)
for
node
in
f
.
maker
.
fgraph
.
toposort
()
...
@@ -92,7 +89,7 @@ def test_local_mul_s_v():
...
@@ -92,7 +89,7 @@ def test_local_mul_s_v():
for
sp_format
in
[
"csr"
]:
# Not implemented for other format
for
sp_format
in
[
"csr"
]:
# Not implemented for other format
inputs
=
[
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
vector
()]
inputs
=
[
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
vector
()]
f
=
pytensor
.
function
(
inputs
,
smath
.
mul_s_v
(
*
inputs
),
mode
=
mode
)
f
=
pytensor
.
function
(
inputs
,
smath
.
mul_s_v
(
*
inputs
),
mode
=
"CVM"
)
assert
not
any
(
assert
not
any
(
isinstance
(
node
.
op
,
smath
.
MulSV
)
for
node
in
f
.
maker
.
fgraph
.
toposort
()
isinstance
(
node
.
op
,
smath
.
MulSV
)
for
node
in
f
.
maker
.
fgraph
.
toposort
()
...
@@ -103,13 +100,10 @@ def test_local_mul_s_v():
...
@@ -103,13 +100,10 @@ def test_local_mul_s_v():
not
pytensor
.
config
.
cxx
,
reason
=
"G++ not available, so we need to skip this test."
not
pytensor
.
config
.
cxx
,
reason
=
"G++ not available, so we need to skip this test."
)
)
def
test_local_structured_add_s_v
():
def
test_local_structured_add_s_v
():
mode
=
get_default_mode
()
mode
=
mode
.
including
(
"specialize"
,
"local_structured_add_s_v"
)
for
sp_format
in
[
"csr"
]:
# Not implemented for other format
for
sp_format
in
[
"csr"
]:
# Not implemented for other format
inputs
=
[
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
vector
()]
inputs
=
[
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
vector
()]
f
=
pytensor
.
function
(
inputs
,
smath
.
structured_add_s_v
(
*
inputs
),
mode
=
mode
)
f
=
pytensor
.
function
(
inputs
,
smath
.
structured_add_s_v
(
*
inputs
),
mode
=
"CVM"
)
assert
not
any
(
assert
not
any
(
isinstance
(
node
.
op
,
smath
.
StructuredAddSV
)
isinstance
(
node
.
op
,
smath
.
StructuredAddSV
)
...
@@ -121,9 +115,6 @@ def test_local_structured_add_s_v():
...
@@ -121,9 +115,6 @@ def test_local_structured_add_s_v():
not
pytensor
.
config
.
cxx
,
reason
=
"G++ not available, so we need to skip this test."
not
pytensor
.
config
.
cxx
,
reason
=
"G++ not available, so we need to skip this test."
)
)
def
test_local_sampling_dot_csr
():
def
test_local_sampling_dot_csr
():
mode
=
get_default_mode
()
mode
=
mode
.
including
(
"specialize"
,
"local_sampling_dot_csr"
)
for
sp_format
in
[
"csr"
]:
# Not implemented for other format
for
sp_format
in
[
"csr"
]:
# Not implemented for other format
inputs
=
[
inputs
=
[
matrix
(),
matrix
(),
...
@@ -131,7 +122,7 @@ def test_local_sampling_dot_csr():
...
@@ -131,7 +122,7 @@ def test_local_sampling_dot_csr():
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
getattr
(
pytensor
.
sparse
,
sp_format
+
"_matrix"
)(),
]
]
f
=
pytensor
.
function
(
inputs
,
smath
.
sampling_dot
(
*
inputs
),
mode
=
mode
)
f
=
pytensor
.
function
(
inputs
,
smath
.
sampling_dot
(
*
inputs
),
mode
=
"CVM"
)
if
pytensor
.
config
.
blas__ldflags
:
if
pytensor
.
config
.
blas__ldflags
:
assert
not
any
(
assert
not
any
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论