Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d6b3dff4
提交
d6b3dff4
authored
2月 01, 2016
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3947 from Sentient07/issue-#3944
Renamed BatchedDotOp to GpuBatchedDot
上级
aecc4921
ed3034a3
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
10 行增加
和
8 行删除
+10
-8
op.txt
doc/library/sandbox/cuda/op.txt
+2
-1
blas.py
theano/sandbox/cuda/blas.py
+3
-2
opt.py
theano/sandbox/cuda/opt.py
+2
-2
test_blas.py
theano/sandbox/cuda/tests/test_blas.py
+3
-3
没有找到文件。
doc/library/sandbox/cuda/op.txt
浏览文件 @
d6b3dff4
.. _libdoc_cuda_op:
======================================================
...
...
@@ -19,7 +20,7 @@ Blas Op
.. automodule:: theano.sandbox.cuda.blas
:members:
.. autoclass:: theano.sandbox.cuda.blas.
BatchedDotOp
.. autoclass:: theano.sandbox.cuda.blas.
GpuBatchedDot
Nnet Op
=======
...
...
theano/sandbox/cuda/blas.py
浏览文件 @
d6b3dff4
...
...
@@ -15,7 +15,7 @@ from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
from
theano.tensor
import
as_tensor_variable
class
BatchedDotOp
(
GpuOp
):
class
GpuBatchedDot
(
GpuOp
):
__props__
=
()
def
make_node
(
self
,
inp1
,
inp2
):
...
...
@@ -216,7 +216,8 @@ class BatchedDotOp(GpuOp):
xshp
,
yshp
=
shapes
return
[
xshp
[:
-
1
]
+
yshp
[
2
:]]
batched_dot
=
BatchedDotOp
()
batched_dot
=
GpuBatchedDot
()
BatchedDotOp
=
GpuBatchedDot
()
"""
Call cublasSgemmBatched. Take 2 3d tensor as input.
"""
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
d6b3dff4
...
...
@@ -33,7 +33,7 @@ from theano.sandbox.cuda.basic_ops import (
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano.sandbox.cuda.blas
import
(
gpu_dot22
,
gpu_dot22scalar
,
gpu_gemm_inplace
,
gpu_gemm_no_inplace
,
GpuConv
,
BatchedDotOp
,
GpuCorrMM
,
GpuCorrMM_gradInputs
,
GpuCorrMM_gradWeights
,
GpuBatchedDot
,
GpuCorrMM
,
GpuCorrMM_gradInputs
,
GpuCorrMM_gradWeights
,
GpuCorr3dMM
,
GpuCorr3dMM_gradInputs
,
GpuCorr3dMM_gradWeights
)
from
theano.sandbox.cuda.blas
import
gpu_gemv_inplace
...
...
@@ -629,7 +629,7 @@ def local_gpu_batched_dot(node):
x_
=
x_
.
dimshuffle
(
0
,
"x"
,
1
)
if
y
.
ndim
==
2
:
y_
=
y_
.
dimshuffle
(
0
,
1
,
"x"
)
z
=
BatchedDotOp
()(
as_cuda_ndarray_variable
(
x_
),
z
=
GpuBatchedDot
()(
as_cuda_ndarray_variable
(
x_
),
as_cuda_ndarray_variable
(
y_
))
# unpad z shape
if
x
.
ndim
==
2
:
...
...
theano/sandbox/cuda/tests/test_blas.py
浏览文件 @
d6b3dff4
...
...
@@ -23,7 +23,7 @@ import theano.compile.mode
from
theano.tensor.tests.test_blas
import
BaseGemv
,
TestBlasStrides
,
TestGer
from
theano.sandbox.cuda.blas
import
gpu_gemv_no_inplace
,
gpu_gemv_inplace
from
theano.sandbox.cuda.blas
import
gpu_ger_inplace
,
gpu_ger_no_inplace
from
theano.sandbox.cuda.blas
import
batched_dot
,
BatchedDotOp
from
theano.sandbox.cuda.blas
import
batched_dot
,
GpuBatchedDot
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
...
...
@@ -121,9 +121,9 @@ class TestBatchedDot(unittest_tools.InferShapeTester):
admat_val
=
my_rand
(
7
,
4
,
5
)
bdmat_val
=
my_rand
(
7
,
5
,
3
)
self
.
_compile_and_check
([
admat
,
bdmat
],
[
BatchedDotOp
()(
admat
,
bdmat
)],
[
GpuBatchedDot
()(
admat
,
bdmat
)],
[
admat_val
,
bdmat_val
],
BatchedDotOp
)
GpuBatchedDot
)
def
test_dot22
():
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论