Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
de775205
提交
de775205
authored
1月 11, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
First step of conversion to the new back-end GpuCAReduce.
Added tests and updated the opt to use it. It should not compile for now.
上级
c0cca58a
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
12 行增加
和
5 行删除
+12
-5
elemwise.py
theano/sandbox/gpuarray/elemwise.py
+0
-0
opt.py
theano/sandbox/gpuarray/opt.py
+2
-2
test_elemwise.py
theano/sandbox/gpuarray/tests/test_elemwise.py
+8
-1
test_opt.py
theano/sandbox/gpuarray/tests/test_opt.py
+2
-2
没有找到文件。
theano/sandbox/gpuarray/elemwise.py
浏览文件 @
de775205
差异被折叠。
点击展开。
theano/sandbox/gpuarray/opt.py
浏览文件 @
de775205
...
...
@@ -24,7 +24,7 @@ from theano.sandbox.gpuarray.conv import GpuConv
from
theano.sandbox.gpuarray.nnet
import
(
GpuCrossentropySoftmaxArgmax1HotWithBias
,
GpuCrossentropySoftmax1HotWithBiasDx
)
from
theano.sandbox.gpuarray.elemwise
import
(
GpuElemwise
,
_is_scalar
,
GpuDimShuffle
,
GpuCAReduce
CPY
)
GpuDimShuffle
,
GpuCAReduce
)
from
theano.sandbox.gpuarray.subtensor
import
GpuIncSubtensor
,
GpuSubtensor
from
theano.sandbox.gpuarray.type
import
GpuArrayConstant
...
...
@@ -249,7 +249,7 @@ def local_gpua_incsubtensor(node):
def
local_gpua_careduce
(
node
):
if
(
isinstance
(
node
.
op
.
scalar_op
,
scalar
.
basic
.
Add
)
or
isinstance
(
node
.
op
.
scalar_op
,
scalar
.
basic
.
Mul
)):
return
GpuCAReduce
CPY
(
node
.
op
.
scalar_op
,
axis
=
node
.
op
.
axis
,
return
GpuCAReduce
(
node
.
op
.
scalar_op
,
axis
=
node
.
op
.
axis
,
dtype
=
getattr
(
node
.
op
,
'dtype'
,
None
),
acc_dtype
=
getattr
(
node
.
op
,
'acc_dtype'
,
None
))
...
...
theano/sandbox/gpuarray/tests/test_elemwise.py
浏览文件 @
de775205
...
...
@@ -10,7 +10,7 @@ from theano.tensor.tests.test_elemwise import (test_Broadcast, test_DimShuffle,
from
theano.sandbox.gpuarray.tests.test_basic_ops
import
rand_gpuarray
from
theano.sandbox.gpuarray.elemwise
import
(
GpuElemwise
,
GpuDimShuffle
,
GpuCAReduceCPY
)
GpuCAReduce
,
GpuCAReduce
CPY
)
from
theano.sandbox.gpuarray.type
import
GpuArrayType
from
pygpu.array
import
gpuarray
...
...
@@ -65,3 +65,10 @@ class test_GpuCAReduceCPY(test_CAReduce):
for
op
in
self
.
reds
:
self
.
with_linker
(
gof
.
CLinker
(),
op
,
dtype
=
dtype
,
test_nan
=
True
)
class
test_GpuCAReduce
(
test_GpuCAReduceCPY
):
dtypes
=
[
"float32"
]
bin_dtypes
=
[
"uint8"
,
"int8"
]
op
=
GpuCAReduce
reds
=
[
scalar
.
add
,
scalar
.
mul
]
theano/sandbox/gpuarray/tests/test_opt.py
浏览文件 @
de775205
...
...
@@ -3,7 +3,7 @@ import numpy
import
theano
from
theano.tests
import
unittest_tools
as
utt
from
theano.sandbox.gpuarray.basic_ops
import
GpuAlloc
,
GpuReshape
,
gpu_alloc
from
theano.sandbox.gpuarray.elemwise
import
GpuCAReduce
CPY
from
theano.sandbox.gpuarray.elemwise
import
GpuCAReduce
import
theano.sandbox.gpuarray
from
theano.tests.unittest_tools
import
SkipTest
...
...
@@ -69,7 +69,7 @@ def test_sum_prod():
res
=
f
(
val
)
utt
.
assert_allclose
(
res
,
val
.
sum
())
assert
res
.
shape
==
()
assert
GpuCAReduce
CPY
in
[
type
(
node
.
op
)
assert
GpuCAReduce
in
[
type
(
node
.
op
)
for
node
in
f
.
maker
.
fgraph
.
toposort
()]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论