Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2d9e40e3
提交
2d9e40e3
authored
8月 10, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
numpydoc for theano/sandbox/cuda/fftconv.py
上级
3e1612db
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
39 行增加
和
25 行删除
+39
-25
fftconv.py
theano/sandbox/cuda/fftconv.py
+39
-25
没有找到文件。
theano/sandbox/cuda/fftconv.py
浏览文件 @
2d9e40e3
...
...
@@ -171,10 +171,11 @@ class CuIFFTOp(ScikitsCudaOp):
def
to_complex_gpuarray
(
x
,
copyif
=
False
):
"""
a
dapted version of theano.misc.pycuda_utils.to_gpuarray that takes
A
dapted version of theano.misc.pycuda_utils.to_gpuarray that takes
an array with an extra trailing dimension of length 2 for
real/imaginary parts, and turns it into a complex64 PyCUDA
GPUArray.
"""
if
not
isinstance
(
x
,
CudaNdarray
):
raise
ValueError
(
"We can transfer only CudaNdarray "
...
...
@@ -213,7 +214,8 @@ def bptrs(a):
"""
Pointer array when input represents a batch of matrices.
taken from scikits.cuda tests/test_cublas.py
Taken from scikits.cuda tests/test_cublas.py.
"""
return
pycuda
.
gpuarray
.
arange
(
a
.
ptr
,
a
.
ptr
+
a
.
shape
[
0
]
*
a
.
strides
[
0
],
a
.
strides
[
0
],
dtype
=
cublas
.
ctypes
.
c_void_p
)
...
...
@@ -222,8 +224,9 @@ def bptrs(a):
def
sc_complex_dot_batched
(
bx_gpu
,
by_gpu
,
bc_gpu
,
transa
=
'N'
,
transb
=
'N'
,
handle
=
None
):
"""
uses cublasCgemmBatched to compute a bunch of complex dot products
in parallel
Uses cublasCgemmBatched to compute a bunch of complex dot products
in parallel.
"""
if
handle
is
None
:
handle
=
scikits
.
cuda
.
misc
.
_global_cublas_handle
...
...
@@ -292,7 +295,9 @@ class BatchedComplexDotOp(ScikitsCudaOp):
"""
This version uses cublasCgemmBatched under the hood, instead of
doing multiple cublasCgemm calls.
"""
def
make_node
(
self
,
inp1
,
inp2
):
inp1
=
basic_ops
.
gpu_contiguous
(
basic_ops
.
as_cuda_ndarray_variable
(
inp1
))
...
...
@@ -355,10 +360,15 @@ batched_complex_dot = BatchedComplexDotOp()
def
mult_and_reduce
(
input_fft_v
,
filters_fft_v
,
input_shape
=
None
,
filter_shape
=
None
):
"""
input_fft_v is (b, ic, i0, i1//2 + 1, 2)
filters_fft_v is (oc, ic, i0, i1//2 + 1, 2)
"""
Parameters
----------
input_fft_v
It's (b, ic, i0, i1//2 + 1, 2).
filters_fft_v
It's (oc, ic, i0, i1//2 + 1, 2).
"""
if
input_shape
is
None
:
input_shape
=
input_fft_v
.
shape
# symbolic
...
...
@@ -405,16 +415,19 @@ def conv2d_fft(input, filters, image_shape=None, filter_shape=None,
On valid mode the filters must be smaller than the input.
input: (b, ic, i0, i1)
filters: (oc, ic, f0, f1)
border_mode: 'valid' of 'full'
Parameters
----------
input
(b, ic, i0, i1).
filters
(oc, ic, f0, f1).
border_mode : {'valid', 'full'}
pad_last_dim
Unconditionally pad the last dimension of the input
to to turn it from odd to even. Will strip the
padding before returning the result.
pad_last_dim: Unconditionally pad the last dimension of the input
to to turn it from odd to even. Will strip the
padding before returning the result.
"""
# use symbolic shapes to compute shape info at runtime if not specified
if
image_shape
is
None
:
image_shape
=
input
.
shape
...
...
@@ -546,16 +559,19 @@ def conv3d_fft(input, filters, image_shape=None, filter_shape=None,
On valid mode the filters must be smaller than the input.
input: (b, ic, i0, i1, i2)
filters: (oc, ic, f0, f1, i2)
border_mode: 'valid' of 'full'
Parameters
----------
input
(b, ic, i0, i1, i2).
filters
(oc, ic, f0, f1, i2).
border_mode : {'valid', 'full'}.
pad_last_dim
Unconditionally pad the last dimension of the input
to to turn it from odd to even. Will strip the
padding before returning the result.
pad_last_dim: Unconditionally pad the last dimension of the input
to to turn it from odd to even. Will strip the
padding before returning the result.
"""
# use symbolic shapes to compute shape info at runtime if not specified
if
image_shape
is
None
:
image_shape
=
input
.
shape
...
...
@@ -670,5 +686,3 @@ def conv3d_fft(input, filters, image_shape=None, filter_shape=None,
# output should now be the result of a batched valid convolution
# of the input with the filters.
return
basic_ops
.
as_cuda_ndarray_variable
(
output
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论