Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
94059e32
提交
94059e32
authored
7月 09, 2015
作者:
Iban Harlouchet
提交者:
Iban Harlouchet
7月 23, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
flake8 for theano/misc/may_share_memory.py
上级
00501098
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
5 行删除
+5
-5
may_share_memory.py
theano/misc/may_share_memory.py
+5
-4
test_flake8.py
theano/tests/test_flake8.py
+0
-1
没有找到文件。
theano/misc/may_share_memory.py
浏览文件 @
94059e32
...
@@ -3,8 +3,6 @@ Function to detect memory sharing for ndarray AND sparse type AND CudaNdarray.
...
@@ -3,8 +3,6 @@ Function to detect memory sharing for ndarray AND sparse type AND CudaNdarray.
numpy version support only ndarray.
numpy version support only ndarray.
"""
"""
__docformat__
=
"restructuredtext en"
import
numpy
import
numpy
from
theano.tensor.basic
import
TensorType
from
theano.tensor.basic
import
TensorType
...
@@ -20,6 +18,8 @@ except ImportError:
...
@@ -20,6 +18,8 @@ except ImportError:
return
False
return
False
from
theano.sandbox
import
cuda
from
theano.sandbox
import
cuda
from
theano.sandbox
import
gpuarray
if
cuda
.
cuda_available
:
if
cuda
.
cuda_available
:
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano.sandbox.cuda.type
import
CudaNdarrayType
...
@@ -29,8 +29,9 @@ else:
...
@@ -29,8 +29,9 @@ else:
def
_is_cuda
(
a
):
def
_is_cuda
(
a
):
return
False
return
False
__docformat__
=
"restructuredtext en"
from
theano.sandbox
import
gpuarray
if
gpuarray
.
pygpu
:
if
gpuarray
.
pygpu
:
def
_is_gpua
(
a
):
def
_is_gpua
(
a
):
return
isinstance
(
a
,
gpuarray
.
pygpu
.
gpuarray
.
GpuArray
)
return
isinstance
(
a
,
gpuarray
.
pygpu
.
gpuarray
.
GpuArray
)
...
@@ -56,7 +57,7 @@ def may_share_memory(a, b, raise_other_type=True):
...
@@ -56,7 +57,7 @@ def may_share_memory(a, b, raise_other_type=True):
a_sparse
=
_is_sparse
(
a
)
a_sparse
=
_is_sparse
(
a
)
b_sparse
=
_is_sparse
(
b
)
b_sparse
=
_is_sparse
(
b
)
if
(
not
(
a_ndarray
or
a_sparse
or
a_cuda
or
a_gpua
)
or
if
(
not
(
a_ndarray
or
a_sparse
or
a_cuda
or
a_gpua
)
or
not
(
b_ndarray
or
b_sparse
or
b_cuda
or
b_gpua
)):
not
(
b_ndarray
or
b_sparse
or
b_cuda
or
b_gpua
)):
if
raise_other_type
:
if
raise_other_type
:
raise
TypeError
(
"may_share_memory support only ndarray"
raise
TypeError
(
"may_share_memory support only ndarray"
" and scipy.sparse, CudaNdarray or GpuArray type"
)
" and scipy.sparse, CudaNdarray or GpuArray type"
)
...
...
theano/tests/test_flake8.py
浏览文件 @
94059e32
...
@@ -184,7 +184,6 @@ whitelist_flake8 = [
...
@@ -184,7 +184,6 @@ whitelist_flake8 = [
"scan_module/scan_opt.py"
,
"scan_module/scan_opt.py"
,
"scan_module/tests/test_scan.py"
,
"scan_module/tests/test_scan.py"
,
"scan_module/tests/test_scan_opt.py"
,
"scan_module/tests/test_scan_opt.py"
,
"misc/may_share_memory.py"
,
"misc/safe_asarray.py"
,
"misc/safe_asarray.py"
,
"misc/pycuda_init.py"
,
"misc/pycuda_init.py"
,
"misc/check_duplicate_key.py"
,
"misc/check_duplicate_key.py"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论