Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f15a953c
提交
f15a953c
authored
9月 29, 2025
作者:
Virgile Andreani
提交者:
Ricardo Vieira
10月 07, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove npy<2 compatibility for ndarray_c_version
上级
a1d07eb8
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
5 行增加
和
7 行删除
+5
-7
basic.py
pytensor/link/c/basic.py
+2
-3
npy_2_compat.py
pytensor/npy_2_compat.py
+0
-4
utils.py
pytensor/utils.py
+3
-0
没有找到文件。
pytensor/link/c/basic.py
浏览文件 @
f15a953c
...
@@ -29,8 +29,7 @@ from pytensor.link.c.cmodule import (
...
@@ -29,8 +29,7 @@ from pytensor.link.c.cmodule import (
from
pytensor.link.c.cmodule
import
get_module_cache
as
_get_module_cache
from
pytensor.link.c.cmodule
import
get_module_cache
as
_get_module_cache
from
pytensor.link.c.interface
import
CLinkerObject
,
CLinkerOp
,
CLinkerType
from
pytensor.link.c.interface
import
CLinkerObject
,
CLinkerOp
,
CLinkerType
from
pytensor.link.utils
import
gc_helper
,
map_storage
,
raise_with_op
,
streamline
from
pytensor.link.utils
import
gc_helper
,
map_storage
,
raise_with_op
,
streamline
from
pytensor.npy_2_compat
import
ndarray_c_version
from
pytensor.utils
import
NDARRAY_C_VERSION
,
difference
,
uniq
from
pytensor.utils
import
difference
,
uniq
NoParams
=
object
()
NoParams
=
object
()
...
@@ -1367,7 +1366,7 @@ class CLinker(Linker):
...
@@ -1367,7 +1366,7 @@ class CLinker(Linker):
# We must always add the numpy ABI version here as
# We must always add the numpy ABI version here as
# DynamicModule always add the include <numpy/arrayobject.h>
# DynamicModule always add the include <numpy/arrayobject.h>
sig
.
append
(
f
"NPY_ABI_VERSION=0x{
ndarray_c_version
:X}"
)
sig
.
append
(
f
"NPY_ABI_VERSION=0x{
NDARRAY_C_VERSION
:X}"
)
if
c_compiler
:
if
c_compiler
:
sig
.
append
(
"c_compiler_str="
+
c_compiler
.
version_str
())
sig
.
append
(
"c_compiler_str="
+
c_compiler
.
version_str
())
...
...
pytensor/npy_2_compat.py
浏览文件 @
f15a953c
...
@@ -10,10 +10,6 @@ numpy_version = np.lib.NumpyVersion(
...
@@ -10,10 +10,6 @@ numpy_version = np.lib.NumpyVersion(
using_numpy_2
=
numpy_version
>=
"2.0.0rc1"
using_numpy_2
=
numpy_version
>=
"2.0.0rc1"
if
using_numpy_2
:
ndarray_c_version
=
np
.
_core
.
_multiarray_umath
.
_get_ndarray_c_version
()
# type: ignore[attr-defined]
else
:
ndarray_c_version
=
np
.
core
.
_multiarray_umath
.
_get_ndarray_c_version
()
# type: ignore[attr-defined]
# function that replicates np.unique from numpy < 2.0
# function that replicates np.unique from numpy < 2.0
...
...
pytensor/utils.py
浏览文件 @
f15a953c
...
@@ -22,6 +22,7 @@ __all__ = [
...
@@ -22,6 +22,7 @@ __all__ = [
"LOCAL_BITWIDTH"
,
"LOCAL_BITWIDTH"
,
"PYTHON_INT_BITWIDTH"
,
"PYTHON_INT_BITWIDTH"
,
"NPY_RAVEL_AXIS"
,
"NPY_RAVEL_AXIS"
,
"NDARRAY_C_VERSION"
,
"NoDuplicateOptWarningFilter"
,
"NoDuplicateOptWarningFilter"
,
]
]
...
@@ -54,6 +55,8 @@ NPY_RAVEL_AXIS = np.iinfo(np.int32).min
...
@@ -54,6 +55,8 @@ NPY_RAVEL_AXIS = np.iinfo(np.int32).min
The value of the numpy C API NPY_RAVEL_AXIS.
The value of the numpy C API NPY_RAVEL_AXIS.
"""
"""
NDARRAY_C_VERSION
=
np
.
_core
.
_multiarray_umath
.
_get_ndarray_c_version
()
# type: ignore[attr-defined]
def
__call_excepthooks
(
type
,
value
,
trace
):
def
__call_excepthooks
(
type
,
value
,
trace
):
"""
"""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论