Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d0e35832
提交
d0e35832
authored
3月 02, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
3月 03, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix typing issues in aesara.link.c.cmodule
上级
41c10974
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
10 行删除
+31
-10
cmodule.py
aesara/link/c/cmodule.py
+31
-6
setup.cfg
setup.cfg
+0
-4
没有找到文件。
aesara/link/c/cmodule.py
浏览文件 @
d0e35832
...
...
@@ -19,9 +19,10 @@ import textwrap
import
time
import
warnings
from
io
import
BytesIO
,
StringIO
from
typing
import
Dict
,
List
,
Se
t
from
typing
import
Callable
,
Dict
,
List
,
Optional
,
Set
,
Tuple
,
cas
t
import
numpy.distutils
from
typing_extensions
import
Protocol
# we will abuse the lockfile mechanism when reading and writing the registry
from
aesara.compile.compilelock
import
lock_ctx
...
...
@@ -39,6 +40,26 @@ from aesara.utils import (
)
class
StdLibDirsAndLibsType
(
Protocol
):
data
:
Optional
[
Tuple
[
List
[
str
],
...
]]
__call__
:
Callable
[[],
Optional
[
Tuple
[
List
[
str
],
...
]]]
def
is_StdLibDirsAndLibsType
(
fn
:
Callable
[[],
Optional
[
Tuple
[
List
[
str
],
...
]]]
)
->
StdLibDirsAndLibsType
:
return
cast
(
StdLibDirsAndLibsType
,
fn
)
class
GCCLLVMType
(
Protocol
):
is_llvm
:
Optional
[
bool
]
__call__
:
Callable
[[],
Optional
[
bool
]]
def
is_GCCLLVMType
(
fn
:
Callable
[[],
Optional
[
bool
]])
->
GCCLLVMType
:
return
cast
(
GCCLLVMType
,
fn
)
_logger
=
logging
.
getLogger
(
"aesara.link.c.cmodule"
)
METH_VARARGS
=
"METH_VARARGS"
...
...
@@ -1649,7 +1670,8 @@ def std_include_dirs():
return
numpy_inc_dirs
+
python_inc_dirs
+
[
gof_inc_dir
]
def
std_lib_dirs_and_libs
():
@is_StdLibDirsAndLibsType
def
std_lib_dirs_and_libs
()
->
Optional
[
Tuple
[
List
[
str
],
...
]]:
# We cache the results as on Windows, this trigger file access and
# this method is called many times.
if
std_lib_dirs_and_libs
.
data
is
not
None
:
...
...
@@ -1730,7 +1752,7 @@ def std_lib_dirs_and_libs():
# get the name of the python library (shared object)
libname
=
distutils
.
sysconfig
.
get_config_var
(
"LDLIBRARY"
)
libname
=
str
(
distutils
.
sysconfig
.
get_config_var
(
"LDLIBRARY"
)
)
if
libname
.
startswith
(
"lib"
):
libname
=
libname
[
3
:]
...
...
@@ -1741,7 +1763,7 @@ def std_lib_dirs_and_libs():
elif
libname
.
endswith
(
".a"
):
libname
=
libname
[:
-
2
]
libdir
=
distutils
.
sysconfig
.
get_config_var
(
"LIBDIR"
)
libdir
=
str
(
distutils
.
sysconfig
.
get_config_var
(
"LIBDIR"
)
)
std_lib_dirs_and_libs
.
data
=
[
libname
],
[
libdir
]
...
...
@@ -1749,7 +1771,9 @@ def std_lib_dirs_and_libs():
# explicitly where it is located this returns
# somepath/lib/python2.x
python_lib
=
distutils
.
sysconfig
.
get_python_lib
(
plat_specific
=
1
,
standard_lib
=
1
)
python_lib
=
str
(
distutils
.
sysconfig
.
get_python_lib
(
plat_specific
=
True
,
standard_lib
=
True
)
)
python_lib
=
os
.
path
.
dirname
(
python_lib
)
if
python_lib
not
in
std_lib_dirs_and_libs
.
data
[
1
]:
std_lib_dirs_and_libs
.
data
[
1
]
.
append
(
python_lib
)
...
...
@@ -1771,7 +1795,8 @@ def gcc_version():
return
gcc_version_str
def
gcc_llvm
():
@is_GCCLLVMType
def
gcc_llvm
()
->
Optional
[
bool
]:
"""
Detect if the g++ version used is the llvm one or not.
...
...
setup.cfg
浏览文件 @
d0e35832
...
...
@@ -115,10 +115,6 @@ check_untyped_defs = False
ignore_errors = True
check_untyped_defs = False
[mypy-aesara.link.c.cmodule]
ignore_errors = True
check_untyped_defs = False
[mypy-aesara.link.c.cvm]
ignore_errors = True
check_untyped_defs = False
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论