Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
84a88de8
提交
84a88de8
authored
10月 05, 2020
作者:
Brandon T. Willard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove sys.version_info uses for Python 2.x logic
上级
10082356
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
4 行增加
和
26 行删除
+4
-26
_version.py
theano/_version.py
+1
-3
cmodule.py
theano/gof/cmodule.py
+2
-5
basic.py
theano/tensor/basic.py
+0
-3
subtensor.py
theano/tensor/subtensor.py
+1
-15
没有找到文件。
theano/_version.py
浏览文件 @
84a88de8
...
@@ -96,9 +96,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
...
@@ -96,9 +96,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
if
verbose
:
if
verbose
:
print
(
"unable to find command, tried
%
s"
%
(
commands
,))
print
(
"unable to find command, tried
%
s"
%
(
commands
,))
return
None
,
None
return
None
,
None
stdout
=
p
.
communicate
()[
0
]
.
strip
()
stdout
=
p
.
communicate
()[
0
]
.
strip
()
.
decode
()
if
sys
.
version_info
[
0
]
>=
3
:
stdout
=
stdout
.
decode
()
if
p
.
returncode
!=
0
:
if
p
.
returncode
!=
0
:
if
verbose
:
if
verbose
:
print
(
"unable to run
%
s (error)"
%
dispcmd
)
print
(
"unable to run
%
s (error)"
%
dispcmd
)
...
...
theano/gof/cmodule.py
浏览文件 @
84a88de8
...
@@ -1767,10 +1767,7 @@ def std_lib_dirs_and_libs():
...
@@ -1767,10 +1767,7 @@ def std_lib_dirs_and_libs():
else
:
else
:
if
platform
.
python_implementation
()
==
"PyPy"
:
if
platform
.
python_implementation
()
==
"PyPy"
:
# Assume Linux (note: Ubuntu doesn't ship this .so)
# Assume Linux (note: Ubuntu doesn't ship this .so)
if
sys
.
version_info
<
(
3
,):
libname
=
"pypy3-c"
libname
=
"pypy-c"
else
:
libname
=
"pypy3-c"
# Unfortunately the only convention of this .so is that it appears
# Unfortunately the only convention of this .so is that it appears
# next to the location of the interpreter binary.
# next to the location of the interpreter binary.
libdir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
sys
.
executable
))
libdir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
sys
.
executable
))
...
@@ -2353,7 +2350,7 @@ class GCC_compiler(Compiler):
...
@@ -2353,7 +2350,7 @@ class GCC_compiler(Compiler):
# redefinition for recent CPython versions (>=2.7.16 and >=3.7.3).
# redefinition for recent CPython versions (>=2.7.16 and >=3.7.3).
# The following nullifies that redefinition, if it is found.
# The following nullifies that redefinition, if it is found.
python_version
=
sys
.
version_info
[:
3
]
python_version
=
sys
.
version_info
[:
3
]
if
python_version
<
(
2
,
7
,
16
)
or
(
3
,)
<=
python_version
<
(
3
,
7
,
3
):
if
(
3
,)
<=
python_version
<
(
3
,
7
,
3
):
config_h_filename
=
distutils
.
sysconfig
.
get_config_h_filename
()
config_h_filename
=
distutils
.
sysconfig
.
get_config_h_filename
()
try
:
try
:
with
open
(
config_h_filename
)
as
config_h
:
with
open
(
config_h_filename
)
as
config_h
:
...
...
theano/tensor/basic.py
浏览文件 @
84a88de8
...
@@ -4025,9 +4025,6 @@ class Split(Op):
...
@@ -4025,9 +4025,6 @@ class Split(Op):
def
perform
(
self
,
node
,
inputs
,
outputs
):
def
perform
(
self
,
node
,
inputs
,
outputs
):
"""WRITEME"""
"""WRITEME"""
x
,
axis
,
splits
=
inputs
x
,
axis
,
splits
=
inputs
# in python 2.4, x.shape[numpy.asarray(1)] don't work.
if
sys
.
version_info
[
0
:
2
]
==
(
2
,
4
)
and
axis
.
size
==
1
:
axis
=
int
(
axis
)
try
:
try
:
len_along_axis
=
x
.
shape
[
axis
]
len_along_axis
=
x
.
shape
[
axis
]
...
...
theano/tensor/subtensor.py
浏览文件 @
84a88de8
...
@@ -1541,21 +1541,7 @@ class IncSubtensor(Op):
...
@@ -1541,21 +1541,7 @@ class IncSubtensor(Op):
def
convert
(
entry
):
def
convert
(
entry
):
if
isinstance
(
entry
,
gof
.
Type
):
if
isinstance
(
entry
,
gof
.
Type
):
rval
=
indices
.
pop
()
return
indices
.
pop
()
if
sys
.
version_info
<
(
2
,
5
):
# Before Python 2.5, PySlice_GetIndicesEx requires
# Python int to be passed.
rval_
=
int
(
rval
)
if
rval_
!=
rval
:
raise
IndexError
(
(
"Invalid value for indexing:
%
s. "
"That value may be too big."
)
%
rval
)
return
rval_
return
rval
elif
isinstance
(
entry
,
slice
):
elif
isinstance
(
entry
,
slice
):
return
slice
(
return
slice
(
convert
(
entry
.
start
),
convert
(
entry
.
stop
),
convert
(
entry
.
step
)
convert
(
entry
.
start
),
convert
(
entry
.
stop
),
convert
(
entry
.
step
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论