Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2bac5a41
提交
2bac5a41
authored
12月 14, 2015
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3767 from lamblin/gpuarray_py3
Fixes for python 3 in sandbox/gpuarray
上级
f000e752
baf4f195
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
11 行增加
和
4 行删除
+11
-4
basic_ops.py
theano/sandbox/gpuarray/basic_ops.py
+9
-2
dnn.py
theano/sandbox/gpuarray/dnn.py
+1
-1
subtensor.py
theano/sandbox/gpuarray/subtensor.py
+1
-1
没有找到文件。
theano/sandbox/gpuarray/basic_ops.py
浏览文件 @
2bac5a41
...
@@ -12,7 +12,7 @@ from theano.gof.utils import MethodNotDefined
...
@@ -12,7 +12,7 @@ from theano.gof.utils import MethodNotDefined
from
collections
import
deque
from
collections
import
deque
from
six
import
string_types
from
six
import
string_types
,
iterbytes
from
six.moves
import
xrange
from
six.moves
import
xrange
try
:
try
:
...
@@ -195,7 +195,7 @@ class GpuKernelBase(object):
...
@@ -195,7 +195,7 @@ class GpuKernelBase(object):
gk
=
gpuarray
.
GpuKernel
(
k
.
code
,
k
.
name
,
k
.
params
,
context
=
ctx
,
gk
=
gpuarray
.
GpuKernel
(
k
.
code
,
k
.
name
,
k
.
params
,
context
=
ctx
,
**
k
.
flags
)
**
k
.
flags
)
bin
=
gk
.
_binary
bin
=
gk
.
_binary
bcode
=
','
.
join
(
hex
(
ord
(
c
))
for
c
in
bin
)
bcode
=
','
.
join
(
hex
(
c
)
for
c
in
iterbytes
(
bin
)
)
return
(
"""static const char
%(bname)
s[] = {
%(bcode)
s };"""
%
return
(
"""static const char
%(bname)
s[] = {
%(bcode)
s };"""
%
dict
(
bname
=
k
.
binvar
,
bcode
=
bcode
))
dict
(
bname
=
k
.
binvar
,
bcode
=
bcode
))
...
@@ -943,6 +943,13 @@ class GpuJoin(HideC, Join):
...
@@ -943,6 +943,13 @@ class GpuJoin(HideC, Join):
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
2
,)
return
(
2
,)
def
c_support_code
(
self
):
return
"""
#if PY_MAJOR_VERSION >= 3
#define PyInt_AsLong PyLong_AsLong
#endif
"""
def
c_code
(
self
,
node
,
name
,
inputs
,
out_
,
sub
):
def
c_code
(
self
,
node
,
name
,
inputs
,
out_
,
sub
):
copy_to_list
=
[]
copy_to_list
=
[]
restype
=
pygpu
.
gpuarray
.
dtype_to_typecode
(
node
.
outputs
[
0
]
.
dtype
)
restype
=
pygpu
.
gpuarray
.
dtype_to_typecode
(
node
.
outputs
[
0
]
.
dtype
)
...
...
theano/sandbox/gpuarray/dnn.py
浏览文件 @
2bac5a41
...
@@ -119,7 +119,7 @@ def dnn_available(context_name):
...
@@ -119,7 +119,7 @@ def dnn_available(context_name):
# This is a hack because bin_id is in the from of
# This is a hack because bin_id is in the from of
# "<something>_<major><minor>" for cuda devices.
# "<something>_<major><minor>" for cuda devices.
if
ctx
.
bin_id
[
:
-
2
]
<
'30'
:
if
ctx
.
bin_id
[
-
2
:]
<
b
'30'
:
dnn_available
.
msg
=
"Device not supported by cuDNN"
dnn_available
.
msg
=
"Device not supported by cuDNN"
return
False
return
False
...
...
theano/sandbox/gpuarray/subtensor.py
浏览文件 @
2bac5a41
...
@@ -632,7 +632,7 @@ class GpuAdvancedIncSubtensor1_dev20(GpuKernelBase, GpuAdvancedIncSubtensor1):
...
@@ -632,7 +632,7 @@ class GpuAdvancedIncSubtensor1_dev20(GpuKernelBase, GpuAdvancedIncSubtensor1):
if
(
self
.
set_instead_of_inc
or
if
(
self
.
set_instead_of_inc
or
node
.
inputs
[
0
]
.
ndim
!=
node
.
inputs
[
1
]
.
ndim
or
node
.
inputs
[
0
]
.
ndim
!=
node
.
inputs
[
1
]
.
ndim
or
node
.
inputs
[
0
]
.
ndim
!=
2
or
node
.
inputs
[
0
]
.
ndim
!=
2
or
ctx
.
bin_id
[
-
2
]
<
'2'
):
ctx
.
bin_id
[
-
2
]
<
b
'2'
):
raise
NotImplementedError
(
"This case does not have C code yet."
)
raise
NotImplementedError
(
"This case does not have C code yet."
)
x
=
inputs
[
0
]
x
=
inputs
[
0
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论