Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a3dbdec3
提交
a3dbdec3
authored
10月 21, 2020
作者:
Brandon T. Willard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply isort to tests.gpuarray sub-package modules
上级
88599bc3
隐藏空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
252 行增加
和
331 行删除
+252
-331
check_dnn_conv.py
tests/gpuarray/check_dnn_conv.py
+12
-25
config.py
tests/gpuarray/config.py
+1
-1
run_dnn_conv.py
tests/gpuarray/run_dnn_conv.py
+7
-14
test_abstractconv.py
tests/gpuarray/test_abstractconv.py
+17
-18
test_basic_ops.py
tests/gpuarray/test_basic_ops.py
+24
-24
test_blas.py
tests/gpuarray/test_blas.py
+12
-14
test_blocksparse.py
tests/gpuarray/test_blocksparse.py
+5
-9
test_cgpukernelbase.py
tests/gpuarray/test_cgpukernelbase.py
+5
-7
test_ctc.py
tests/gpuarray/test_ctc.py
+7
-13
test_dnn.py
tests/gpuarray/test_dnn.py
+36
-34
test_elemwise.py
tests/gpuarray/test_elemwise.py
+13
-13
test_extra_ops.py
tests/gpuarray/test_extra_ops.py
+6
-9
test_fft.py
tests/gpuarray/test_fft.py
+3
-5
test_gemmcorr.py
tests/gpuarray/test_gemmcorr.py
+6
-10
test_gemmcorr3d.py
tests/gpuarray/test_gemmcorr3d.py
+6
-14
test_linalg.py
tests/gpuarray/test_linalg.py
+10
-14
test_misc.py
tests/gpuarray/test_misc.py
+1
-3
test_multinomial.py
tests/gpuarray/test_multinomial.py
+7
-11
test_neighbours.py
tests/gpuarray/test_neighbours.py
+2
-3
test_nnet.py
tests/gpuarray/test_nnet.py
+6
-7
test_opt.py
tests/gpuarray/test_opt.py
+13
-16
test_others.py
tests/gpuarray/test_others.py
+9
-9
test_pickle.py
tests/gpuarray/test_pickle.py
+3
-5
test_pool.py
tests/gpuarray/test_pool.py
+13
-17
test_reduction.py
tests/gpuarray/test_reduction.py
+4
-7
test_rng_mrg.py
tests/gpuarray/test_rng_mrg.py
+5
-7
test_scan.py
tests/gpuarray/test_scan.py
+1
-4
test_sort.py
tests/gpuarray/test_sort.py
+2
-3
test_subtensor.py
tests/gpuarray/test_subtensor.py
+10
-12
test_type.py
tests/gpuarray/test_type.py
+6
-3
没有找到文件。
tests/gpuarray/check_dnn_conv.py
浏览文件 @
a3dbdec3
...
@@ -13,39 +13,26 @@
...
@@ -13,39 +13,26 @@
# Else, any arg will be directly passed to pytest.
# Else, any arg will be directly passed to pytest.
# python check_dnn_conv.py -xvs # verbose mode, capture output, exit at first error.
# python check_dnn_conv.py -xvs # verbose mode, capture output, exit at first error.
import
sys
import
math
import
math
import
sys
import
pytes
t
from
itertools
import
chain
,
produc
t
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
tests.unittest_tools
as
utt
import
tests.unittest_tools
as
utt
import
theano
from
itertools
import
product
,
chain
from
tests.gpuarray.config
import
mode_with_gpu
,
ref_cast
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_RUNTIME
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_RUNTIME
from
theano.gpuarray
import
cudnn_defs
from
theano.gpuarray
import
cudnn_defs
from
theano.gpuarray.dnn
import
(
from
theano.gpuarray.dnn
import
GpuDnnConv
,
GpuDnnConvGradI
,
GpuDnnConvGradW
GpuDnnConv
,
from
theano.gpuarray.dnn
import
_dnn_conv
as
dnn_conv
GpuDnnConvGradW
,
from
theano.gpuarray.dnn
import
_dnn_gradinput
as
dnn_gradinput
GpuDnnConvGradI
,
from
theano.gpuarray.dnn
import
_dnn_gradweight
as
dnn_gradweight
version
,
from
theano.gpuarray.dnn
import
version
_dnn_conv
as
dnn_conv
,
from
theano.tensor.nnet.abstract_conv
import
assert_conv_shape
,
get_conv_output_shape
_dnn_gradinput
as
dnn_gradinput
,
_dnn_gradweight
as
dnn_gradweight
,
)
from
theano.tensor.nnet.abstract_conv
import
get_conv_output_shape
,
assert_conv_shape
from
theano.tensor.nnet.corr
import
CorrMM
,
CorrMM_gradInputs
,
CorrMM_gradWeights
from
theano.tensor.nnet.corr
import
CorrMM
,
CorrMM_gradInputs
,
CorrMM_gradWeights
from
theano.tensor.nnet.corr3d
import
(
from
theano.tensor.nnet.corr3d
import
Corr3dMM
,
Corr3dMMGradInputs
,
Corr3dMMGradWeights
Corr3dMM
,
Corr3dMMGradInputs
,
Corr3dMMGradWeights
,
)
from
tests.gpuarray.config
import
mode_with_gpu
,
ref_cast
def
check_dtype_config_support
(
dtype
,
precision
):
def
check_dtype_config_support
(
dtype
,
precision
):
...
...
tests/gpuarray/config.py
浏览文件 @
a3dbdec3
import
pytest
import
pytest
import
theano.tensor
import
theano.gpuarray
import
theano.gpuarray
import
theano.tensor
if
theano
.
gpuarray
.
pygpu
is
None
:
if
theano
.
gpuarray
.
pygpu
is
None
:
...
...
tests/gpuarray/run_dnn_conv.py
浏览文件 @
a3dbdec3
...
@@ -2,30 +2,23 @@
...
@@ -2,30 +2,23 @@
# This script should not be imported, but only used as a program.
# This script should not be imported, but only used as a program.
# python run_dnn_conv.py --help # Print help.
# python run_dnn_conv.py --help # Print help.
# python run_dnn_conv.py {fwd|bwd-filter|bwd-data} {2d|3d} -a <algo> -i <inputShape> -f <filterShape> ...
# python run_dnn_conv.py {fwd|bwd-filter|bwd-data} {2d|3d} -a <algo> -i <inputShape> -f <filterShape> ...
import
sys
import
argparse
import
argparse
import
sys
import
theano
import
theano
from
tests.gpuarray.check_dnn_conv
import
CheckDnn
,
TestDnnConv2D
,
TestDnnConv3D
,
cudnn
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_RUNTIME
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_RUNTIME
from
theano.gpuarray.cudnn_defs
import
(
from
theano.gpuarray.cudnn_defs
import
(
HALF
,
FLOAT
,
DOUBLE
,
DOUBLE
,
TRUE_HALF_CONFIG
,
PSEUDO_HALF_CONFIG
,
FLOAT_CONFIG
,
DOUBLE_CONFIG
,
DOUBLE_CONFIG
,
FLOAT
,
FLOAT_CONFIG
,
HALF
,
PSEUDO_HALF_CONFIG
,
TRUE_HALF_CONFIG
,
)
)
from
theano.tensor.nnet.abstract_conv
import
get_conv_output_shape
from
theano.tensor.nnet.abstract_conv
import
get_conv_output_shape
from
tests.gpuarray.check_dnn_conv
import
(
cudnn
,
TestDnnConv2D
,
TestDnnConv3D
,
CheckDnn
,
)
if
__name__
!=
"__main__"
:
if
__name__
!=
"__main__"
:
raise
ImportError
(
"This script must not be imported."
)
raise
ImportError
(
"This script must not be imported."
)
...
...
tests/gpuarray/test_abstractconv.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
pytest
import
pytest
import
numpy
as
np
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
gpuarray
=
pygpu
.
gpuarray
gpuarray
=
pygpu
.
gpuarray
from
t
heano.gpuarray.type
import
GpuArrayType
,
gpuarray_shared_constructor
,
get_context
from
t
ests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
t
heano.gpuarray.dnn
import
(
from
t
ests.tensor.nnet.test_abstract_conv
import
(
dnn_available
,
BaseTestConv2d
,
GpuDnnConv
,
BaseTestConv3d
,
GpuDnnConvGradW
,
TestConv2dTranspose
,
GpuDnnConvGradI
,
TestConvTypes
,
)
)
from
theano.gpuarray.blas
import
(
from
theano.gpuarray.blas
import
(
GpuCorrMM
,
GpuCorrMM_gradWeights
,
GpuCorrMM_gradInputs
,
GpuCorr3dMM
,
GpuCorr3dMM
,
GpuCorr3dMM_gradWeights
,
GpuCorr3dMM_gradInputs
,
GpuCorr3dMM_gradInputs
,
GpuCorr3dMM_gradWeights
,
GpuCorrMM
,
GpuCorrMM_gradInputs
,
GpuCorrMM_gradWeights
,
)
)
from
theano.gpuarray.dnn
import
(
from
tests.tensor.nnet.test_abstract_conv
import
(
GpuDnnConv
,
BaseTestConv2d
,
GpuDnnConvGradI
,
BaseTestConv3d
,
GpuDnnConvGradW
,
TestConvTypes
,
dnn_available
,
TestConv2dTranspose
,
)
)
from
t
ests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
t
heano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
gpu_ftensor4
=
GpuArrayType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
4
)
gpu_ftensor4
=
GpuArrayType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
4
)
...
...
tests/gpuarray/test_basic_ops.py
浏览文件 @
a3dbdec3
import
pytest
import
pytest
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
gpuarray
=
pygpu
.
gpuarray
gpuarray
=
pygpu
.
gpuarray
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
import
theano.tensor
as
tt
import
theano.tensor
as
tt
from
tests
import
unittest_tools
as
utt
from
theano.tensor
import
TensorType
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
from
theano.tensor.basic
import
alloc
from
tests.tensor.test_basic
import
(
TestAlloc
,
# Don't import test classes otherwise they get tested as part of the file
TestComparison
,
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
TestJoinAndSplit
,
TestReshape
,
rand
,
safe_make_node
,
)
from
theano.gpuarray.basic_ops
import
(
from
theano.gpuarray.basic_ops
import
(
host_from_gpu
,
HostFromGpu
,
GpuFromHost
,
GpuReshape
,
GpuToGpu
,
GpuAlloc
,
GpuAlloc
,
GpuAllocEmpty
,
GpuAllocEmpty
,
GpuContiguous
,
GpuContiguous
,
gpu_join
,
GpuEye
,
GpuFromHost
,
GpuJoin
,
GpuJoin
,
GpuReshape
,
GpuSplit
,
GpuSplit
,
Gpu
Eye
,
Gpu
ToGpu
,
GpuTri
,
GpuTri
,
HostFromGpu
,
gpu_contiguous
,
gpu_contiguous
,
gpu_join
,
host_from_gpu
,
)
)
from
theano.gpuarray.elemwise
import
GpuDimShuffle
,
GpuElemwise
from
theano.gpuarray.elemwise
import
GpuDimShuffle
,
GpuElemwise
from
theano.gpuarray.subtensor
import
GpuSubtensor
from
theano.gpuarray.subtensor
import
GpuSubtensor
from
tests
import
unittest_tools
as
utt
# Don't import test classes otherwise they get tested as part of the file
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
from
tests.tensor.test_basic
import
(
from
theano.tensor
import
TensorType
rand
,
from
theano.tensor.basic
import
alloc
safe_make_node
,
TestAlloc
,
TestComparison
,
TestReshape
,
TestJoinAndSplit
,
)
utt
.
seed_rng
()
utt
.
seed_rng
()
...
@@ -68,7 +68,7 @@ def inplace_func(
...
@@ -68,7 +68,7 @@ def inplace_func(
def
fake_shared
(
value
,
name
=
None
,
strict
=
False
,
allow_downcast
=
None
,
**
kwargs
):
def
fake_shared
(
value
,
name
=
None
,
strict
=
False
,
allow_downcast
=
None
,
**
kwargs
):
from
theano.tensor.sharedvar
import
tensor_constructor
,
scala
r_constructor
from
theano.tensor.sharedvar
import
scalar_constructor
,
tenso
r_constructor
for
c
in
(
gpuarray_shared_constructor
,
tensor_constructor
,
scalar_constructor
):
for
c
in
(
gpuarray_shared_constructor
,
tensor_constructor
,
scalar_constructor
):
try
:
try
:
...
...
tests/gpuarray/test_blas.py
浏览文件 @
a3dbdec3
import
itertools
import
itertools
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
from
theano
import
config
from
tests
import
unittest_tools
as
utt
from
theano
import
tensor
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
theano.tensor.blas
import
gemv
,
gemv_inplace
,
gemm_inplace
,
_dot22
,
batched_dot
from
tests.gpuarray.test_basic_ops
import
makeTester
,
rand
from
tests.tensor.test_blas
import
BaseGemv
,
TestGer
from
theano
import
config
,
tensor
from
theano.gpuarray
import
gpuarray_shared_constructor
from
theano.gpuarray
import
gpuarray_shared_constructor
from
theano.gpuarray.blas
import
(
from
theano.gpuarray.blas
import
(
gpugemv_inplace
,
GpuGemm
,
gpugemv_no_inplace
,
GpuGer
,
gpu_dot22
,
gpugemm_inplace
,
gpugemm_inplace
,
gpugemm_no_inplace
,
gpugemm_no_inplace
,
gpugemmbatch_inplace
,
gpugemmbatch_inplace
,
gpugemv_inplace
,
gpugemv_no_inplace
,
gpuger_inplace
,
gpuger_inplace
,
gpuger_no_inplace
,
gpuger_no_inplace
,
GpuGer
,
GpuGemm
,
gpu_dot22
,
)
)
from
theano.tensor.blas
import
_dot22
,
batched_dot
,
gemm_inplace
,
gemv
,
gemv_inplace
from
tests
import
unittest_tools
as
utt
from
tests.tensor.test_blas
import
TestGer
,
BaseGemv
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
tests.gpuarray.test_basic_ops
import
makeTester
,
rand
TestGpuGemv
=
makeTester
(
TestGpuGemv
=
makeTester
(
...
...
tests/gpuarray/test_blocksparse.py
浏览文件 @
a3dbdec3
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
tests.unittest_tools
as
utt
import
tests.unittest_tools
as
utt
import
theano
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
tests.tensor.nnet.test_blocksparse
import
TestBlockSparseGemvAndOuter
from
theano
import
tensor
from
theano
import
tensor
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
theano.gpuarray.blocksparse
import
(
from
theano.gpuarray.blocksparse
import
(
GpuSparseBlockGemv
,
GpuSparseBlockGemv
,
GpuSparseBlockOuter
,
GpuSparseBlockOuter
,
gpu_sparse_block_gemv
,
gpu_sparse_block_gemv
,
gpu_sparse_block_outer
,
gpu_sparse_block_outer
,
)
)
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
tests.tensor.nnet.test_blocksparse
import
TestBlockSparseGemvAndOuter
class
TestBlockSparseGemvAndOuterGPUarray
(
TestBlockSparseGemvAndOuter
):
class
TestBlockSparseGemvAndOuterGPUarray
(
TestBlockSparseGemvAndOuter
):
...
...
tests/gpuarray/test_cgpukernelbase.py
浏览文件 @
a3dbdec3
import
pytest
import
numpy
as
np
import
numpy
as
np
import
theano
import
pytest
from
theano
import
tensor
,
config
,
Apply
,
Op
import
theano
from
theano
.scalar
import
int32
as
int_t
from
theano
import
Apply
,
Op
,
config
,
tensor
from
theano.gof
import
ParamsType
from
theano.gof
import
ParamsType
from
theano.gradient
import
grad_undefined
from
theano.gpuarray.basic_ops
import
CGpuKernelBase
from
theano.gpuarray.basic_ops
import
CGpuKernelBase
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpu_context_type
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpu_context_type
from
theano.gradient
import
grad_undefined
from
theano.scalar
import
int32
as
int_t
# This is an implementation to test that CGpuKernelBase works and also
# This is an implementation to test that CGpuKernelBase works and also
...
...
tests/gpuarray/test_ctc.py
浏览文件 @
a3dbdec3
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
theano
import
theano.tensor
as
tt
import
theano.gpuarray
import
theano.gpuarray
import
theano.tensor
as
tt
from
theano.gpuarray.ctc
import
gpu_ctc
,
GpuConnectionistTemporalClassification
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
tests.tensor.nnet.test_ctc
import
setup_ctc_case
,
setup_grad_case
,
setup_torch_case
from
theano.gpuarray.ctc
import
GpuConnectionistTemporalClassification
,
gpu_ctc
from
theano.tensor.nnet.ctc
import
(
from
theano.tensor.nnet.ctc
import
(
ConnectionistTemporalClassification
,
ctc
,
ctc
,
ctc_available
,
ctc_available
,
ConnectionistTemporalClassification
,
)
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
tests.tensor.nnet.test_ctc
import
(
setup_torch_case
,
setup_ctc_case
,
setup_grad_case
,
)
)
...
...
tests/gpuarray/test_dnn.py
浏览文件 @
a3dbdec3
import
logging
import
logging
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
# noqa
import
theano
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
# noqa
import
theano.tensor
as
tt
import
tests.unittest_tools
as
utt
from
itertools
import
product
,
chain
from
collections
import
OrderedDict
from
collections
import
OrderedDict
from
itertools
import
chain
,
product
from
six
import
StringIO
from
six
import
StringIO
import
tests.unittest_tools
as
utt
import
theano
import
theano.tensor
as
tt
from
tests.gpuarray
import
test_nnet
from
tests.gpuarray.config
import
(
mode_with_gpu
,
mode_without_gpu
,
ref_cast
,
test_ctx_name
,
)
from
tests.gpuarray.rnn_support
import
GRU
,
LSTM
,
Model
,
WrapperLayer
from
tests.tensor.nnet.test_abstract_conv
import
(
TestGroupedConv3dNoOptim
,
TestGroupedConvNoOptim
,
)
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_FWD
from
theano.gpuarray
import
dnn
from
theano.gpuarray.basic_ops
import
GpuAllocEmpty
from
theano.gpuarray.type
import
GpuArrayType
,
gpuarray_shared_constructor
from
theano.tensor.nnet
import
(
from
theano.tensor.nnet
import
(
bn
,
softmax_op
,
SoftmaxGrad
,
softmax
,
LogSoftmax
,
LogSoftmax
,
Softmax
,
Softmax
,
SoftmaxGrad
,
bn
,
conv2d
,
conv2d
,
softmax
,
softmax_op
,
)
)
from
theano.tensor.nnet.corr3d
import
Corr3dMM
from
theano.tensor.nnet.corr
import
CorrMM
from
theano.tensor.nnet.abstract_conv
import
(
from
theano.tensor.nnet.abstract_conv
import
(
get_conv_output_shape
,
get_conv_gradinputs_shape
,
get_conv_gradinputs_shape
,
get_conv_output_shape
,
)
)
from
theano.tensor.signal.pool
import
pool_2d
,
pool_3d
from
theano.tensor.nnet.corr
import
CorrMM
from
theano.tensor.signal.pool
import
Pool
,
MaxPoolGrad
,
AveragePoolGrad
from
theano.tensor.nnet.corr3d
import
Corr3dMM
from
theano.tensor.signal.pool
import
(
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_FWD
AveragePoolGrad
,
MaxPoolGrad
,
from
theano.gpuarray
import
dnn
Pool
,
from
theano.gpuarray.basic_ops
import
GpuAllocEmpty
pool_2d
,
from
theano.gpuarray.type
import
gpuarray_shared_constructor
,
GpuArrayType
pool_3d
,
from
tests.tensor.nnet.test_abstract_conv
import
(
TestGroupedConvNoOptim
,
TestGroupedConv3dNoOptim
,
)
from
tests.gpuarray
import
test_nnet
from
tests.gpuarray.config
import
(
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
,
ref_cast
,
)
)
from
tests.gpuarray.rnn_support
import
Model
,
GRU
,
LSTM
,
WrapperLayer
if
not
dnn
.
dnn_available
(
test_ctx_name
):
if
not
dnn
.
dnn_available
(
test_ctx_name
):
...
...
tests/gpuarray/test_elemwise.py
浏览文件 @
a3dbdec3
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
theano
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
gpuarray
=
pygpu
.
ndgpuarray
gpuarray
=
pygpu
.
ndgpuarray
from
copy
import
copy
from
copy
import
copy
from
theano
import
scalar
,
gof
,
tensor
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
from
tests.gpuarray.test_basic_ops
import
rand_gpuarray
from
tests.tensor
import
test_elemwise
from
tests.unittest_tools
import
assert_allclose
from
theano
import
gof
,
scalar
,
tensor
from
theano.compile
import
DebugMode
,
Mode
from
theano.compile
import
DebugMode
,
Mode
from
theano.gpuarray.dnn
import
GpuDnnReduction
from
theano.gpuarray.elemwise
import
(
from
theano.gpuarray.elemwise
import
(
GpuElemwise
,
GpuDimShuffle
,
GpuCAReduceCuda
,
GpuCAReduceCPY
,
GpuCAReduceCPY
,
GpuErfinv
,
GpuCAReduceCuda
,
GpuDimShuffle
,
GpuElemwise
,
GpuErfcinv
,
GpuErfcinv
,
GpuErfinv
,
)
)
from
theano.gpuarray.dnn
import
GpuDnnReduction
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
from
tests.tensor
import
test_elemwise
from
tests.unittest_tools
import
assert_allclose
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
from
tests.gpuarray.test_basic_ops
import
rand_gpuarray
# This is actually a test for GpuElemwise
# This is actually a test for GpuElemwise
class
TestGpuBroadcast
(
test_elemwise
.
TestBroadcast
):
class
TestGpuBroadcast
(
test_elemwise
.
TestBroadcast
):
...
...
tests/gpuarray/test_extra_ops.py
浏览文件 @
a3dbdec3
import
pytest
from
functools
import
partial
from
itertools
import
product
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
theano
import
theano.tensor
as
tt
import
theano.tensor
as
tt
from
functools
import
partial
from
itertools
import
product
from
theano.tensor.extra_ops
import
CumOp
from
theano.gpuarray.extra_ops
import
GpuCumOp
from
theano.gpuarray.type
import
get_context
from
tests
import
unittest_tools
as
utt
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
tests.tensor.test_extra_ops
import
TestCumOp
from
tests.tensor.test_extra_ops
import
TestCumOp
from
theano.gpuarray.extra_ops
import
GpuCumOp
from
theano.gpuarray.type
import
get_context
from
theano.tensor.extra_ops
import
CumOp
class
TestGpuCumOp
(
TestCumOp
):
class
TestGpuCumOp
(
TestCumOp
):
...
...
tests/gpuarray/test_fft.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
numpy
as
np
import
pytest
import
pytest
import
theano
import
theano
import
theano.tensor
as
tt
import
theano.gpuarray.fft
import
theano.gpuarray.fft
import
theano.tensor
as
tt
from
theano.gpuarray.fft
import
pygpu_available
,
skcuda_available
,
pycuda_available
from
tests
import
unittest_tools
as
utt
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
from
tests.gpuarray.config
import
mode_with_gpu
from
theano.gpuarray.fft
import
pycuda_available
,
pygpu_available
,
skcuda_available
# Skip tests if pygpu is not available.
# Skip tests if pygpu is not available.
if
not
pygpu_available
:
# noqa
if
not
pygpu_available
:
# noqa
...
...
tests/gpuarray/test_gemmcorr.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
from
theano
import
config
from
theano.tensor.nnet.corr
import
CorrMM
,
CorrMM_gradWeights
,
CorrMM_gradInputs
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
theano.gpuarray.blas
import
GpuCorrMM
,
GpuCorrMM_gradWeights
,
GpuCorrMM_gradInputs
from
tests
import
unittest_tools
as
utt
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
ref_cast
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
ref_cast
from
tests.tensor.nnet.test_abstract_conv
import
(
TestGroupedConvNoOptim
,
TestUnsharedConv
,
)
from
tests.tensor.nnet.test_abstract_conv
import
(
from
tests.tensor.nnet.test_abstract_conv
import
(
TestAsymmetricPadding
,
TestAsymmetricPadding
,
TestCausalConv
,
TestCausalConv
,
TestGroupedConvNoOptim
,
TestUnsharedConv
,
)
)
from
theano
import
config
from
theano.gpuarray.blas
import
GpuCorrMM
,
GpuCorrMM_gradInputs
,
GpuCorrMM_gradWeights
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
theano.tensor.nnet.corr
import
CorrMM
,
CorrMM_gradInputs
,
CorrMM_gradWeights
class
TestCorrMM
:
class
TestCorrMM
:
...
...
tests/gpuarray/test_gemmcorr3d.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
ref_cast
from
tests.tensor.nnet.test_abstract_conv
import
TestGroupedConv3dNoOptim
from
theano
import
config
from
theano
import
config
from
theano.tensor.nnet.corr3d
import
(
Corr3dMM
,
Corr3dMMGradWeights
,
Corr3dMMGradInputs
,
)
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
theano.gpuarray.blas
import
(
from
theano.gpuarray.blas
import
(
GpuCorr3dMM
,
GpuCorr3dMM
,
GpuCorr3dMM_gradWeights
,
GpuCorr3dMM_gradInputs
,
GpuCorr3dMM_gradInputs
,
GpuCorr3dMM_gradWeights
,
)
)
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
tests
import
unittest_tools
as
utt
from
theano.tensor.nnet.corr3d
import
Corr3dMM
,
Corr3dMMGradInputs
,
Corr3dMMGradWeights
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
ref_cast
from
tests.tensor.nnet.test_abstract_conv
import
TestGroupedConv3dNoOptim
class
TestCorr3dMM
:
class
TestCorr3dMM
:
...
...
tests/gpuarray/test_linalg.py
浏览文件 @
a3dbdec3
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
from
numpy.linalg.linalg
import
LinAlgError
from
numpy.linalg.linalg
import
LinAlgError
import
theano
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
tests.gpuarray.test_basic_ops
import
rand
from
theano
import
config
from
theano
import
config
from
theano.gpuarray
import
gpuarray_shared_constructor
from
theano.gpuarray.linalg
import
(
from
theano.gpuarray.linalg
import
(
GpuCusolverSolve
,
GpuCublasTriangularSolve
,
GpuCholesky
,
GpuCholesky
,
GpuCublasTriangularSolve
,
GpuCusolverSolve
,
GpuMagmaCholesky
,
GpuMagmaCholesky
,
GpuMagmaEigh
,
GpuMagmaEigh
,
GpuMagmaMatrixInverse
,
GpuMagmaMatrixInverse
,
GpuMagmaQR
,
GpuMagmaQR
,
GpuMagmaSVD
,
GpuMagmaSVD
,
cusolver_available
,
cusolver_available
,
gpu_matrix_inverse
,
gpu_cholesky
,
gpu_cholesky
,
gpu_matrix_inverse
,
gpu_qr
,
gpu_solve
,
gpu_solve
,
gpu_solve_lower_triangular
,
gpu_solve_lower_triangular
,
gpu_svd
,
gpu_svd
,
gpu_qr
,
)
)
from
theano.tensor.nlinalg
import
(
from
theano.tensor.nlinalg
import
(
SVD
,
SVD
,
...
@@ -34,11 +35,6 @@ from theano.tensor.nlinalg import (
...
@@ -34,11 +35,6 @@ from theano.tensor.nlinalg import (
qr
,
qr
,
)
)
from
theano.tensor.slinalg
import
Cholesky
,
cholesky
,
imported_scipy
from
theano.tensor.slinalg
import
Cholesky
,
cholesky
,
imported_scipy
from
theano.gpuarray
import
gpuarray_shared_constructor
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
tests.gpuarray.test_basic_ops
import
rand
@pytest.mark.skipif
(
@pytest.mark.skipif
(
...
...
tests/gpuarray/test_misc.py
浏览文件 @
a3dbdec3
...
@@ -3,12 +3,10 @@
...
@@ -3,12 +3,10 @@
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
from
tests.gpuarray.config
import
mode_with_gpu
from
theano
import
tensor
from
theano
import
tensor
from
theano.compile.nanguardmode
import
NanGuardMode
from
theano.compile.nanguardmode
import
NanGuardMode
from
tests.gpuarray.config
import
mode_with_gpu
def
test_nan_guard_mode
():
def
test_nan_guard_mode
():
# Also test that abs uint* and bool have c code.
# Also test that abs uint* and bool have c code.
...
...
tests/gpuarray/test_multinomial.py
浏览文件 @
a3dbdec3
import
os
import
os
from
pickle
import
Unpickler
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
tests.unittest_tools
as
utt
import
tests.unittest_tools
as
utt
import
theano
from
pickle
import
Unpickler
from
tests.gpuarray.config
import
mode_with_gpu
from
theano
import
config
,
function
,
tensor
from
theano
import
config
,
function
,
tensor
from
theano.compat
import
PY3
from
theano.compat
import
PY3
from
theano.sandbox
import
multinomial
from
theano.sandbox.rng_mrg
import
MRG_RandomStreams
as
RandomStreams
from
theano.gpuarray.multinomial
import
(
from
theano.gpuarray.multinomial
import
(
GPUAMultinomialFromUniform
,
GPUAChoiceFromUniform
,
GPUAChoiceFromUniform
,
GPUAMultinomialFromUniform
,
)
)
from
theano.sandbox
import
multinomial
from
t
ests.gpuarray.config
import
mode_with_gpu
from
t
heano.sandbox.rng_mrg
import
MRG_RandomStreams
as
RandomStreams
def
test_multinomial_output_dtype
():
def
test_multinomial_output_dtype
():
...
...
tests/gpuarray/test_neighbours.py
浏览文件 @
a3dbdec3
from
theano.gpuarray.neighbours
import
GpuImages2Neibs
from
tests.tensor.nnet
import
test_neighbours
from
tests.gpuarray.config
import
mode_with_gpu
from
tests.gpuarray.config
import
mode_with_gpu
from
tests.tensor.nnet
import
test_neighbours
from
theano.gpuarray.neighbours
import
GpuImages2Neibs
class
TestGpuImages2Neibs
(
test_neighbours
.
TestImages2Neibs
):
class
TestGpuImages2Neibs
(
test_neighbours
.
TestImages2Neibs
):
...
...
tests/gpuarray/test_nnet.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
numpy
as
np
import
tests.unittest_tools
as
utt
import
theano
import
theano
import
theano.tensor
as
tt
import
theano.tensor
as
tt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
import
tests.unittest_tools
as
utt
from
theano.tensor.nnet
import
crossentropy_softmax_1hot_with_bias_dx
from
theano.gpuarray.nnet
import
(
from
theano.gpuarray.nnet
import
(
GpuCrossentropySoftmaxArgmax1HotWithBias
,
GpuCrossentropySoftmax1HotWithBiasDx
,
GpuCrossentropySoftmax1HotWithBiasDx
,
Gpu
Softmax
WithBias
,
Gpu
CrossentropySoftmaxArgmax1Hot
WithBias
,
GpuSoftmax
,
GpuSoftmax
,
GpuSoftmaxWithBias
,
)
)
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
theano.tensor.nnet
import
crossentropy_softmax_1hot_with_bias_dx
mode_wo_cudnn
=
mode_with_gpu
.
excluding
(
"cudnn"
)
mode_wo_cudnn
=
mode_with_gpu
.
excluding
(
"cudnn"
)
...
...
tests/gpuarray/test_opt.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
numpy
as
np
import
pytest
import
pytest
import
theano
import
theano
import
theano.gpuarray
import
theano.gpuarray
import
theano.tensor.slinalg
as
slinalg
import
theano.tensor.slinalg
as
slinalg
from
tests
import
test_ifelse
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
from
tests.tensor
import
test_basic
from
theano
import
tensor
from
theano
import
tensor
from
theano.gof.opt
import
check_stack_trace
from
theano.tensor.nnet
import
abstract_conv
from
theano.breakpoint
import
PdbBreakpoint
from
theano.breakpoint
import
PdbBreakpoint
from
theano.g
puarray
import
basic_ops
from
theano.g
of.opt
import
check_stack_trace
from
theano.gpuarray
.type
import
GpuArrayType
,
gpuarray_shared_constructor
,
get_contex
t
from
theano.gpuarray
import
basic_ops
,
blas
,
dnn
,
op
t
from
theano.gpuarray.basic_ops
import
(
from
theano.gpuarray.basic_ops
import
(
GpuAlloc
,
GpuAlloc
,
GpuAllocEmpty
,
GpuAllocEmpty
,
GpuReshape
,
GpuFromHost
,
GpuFromHost
,
GpuReshape
,
HostFromGpu
,
HostFromGpu
,
host_from_gpu
,
host_from_gpu
,
)
)
from
theano.gpuarray.blas
import
GpuGemm
from
theano.gpuarray.blas
import
GpuGemm
from
theano.gpuarray.dnn
import
GpuDnnReduction
from
theano.gpuarray.elemwise
import
(
from
theano.gpuarray.elemwise
import
(
GpuCAReduceCuda
,
Elemwise
,
GpuCAReduceCPY
,
GpuCAReduceCPY
,
GpuCAReduceCuda
,
GpuElemwise
,
GpuElemwise
,
Elemwise
,
max_inputs_to_GpuElemwise
,
max_inputs_to_GpuElemwise
,
)
)
from
theano.gpuarray
import
dnn
,
blas
,
opt
from
theano.gpuarray.linalg
import
GpuCholesky
,
GpuCusolverSolve
,
cusolver_available
from
theano.gpuarray.dnn
import
GpuDnnReduction
from
theano.gpuarray.subtensor
import
GpuSubtensor
from
theano.gpuarray.subtensor
import
GpuSubtensor
from
theano.gpuarray.linalg
import
GpuCusolverSolve
,
cusolver_available
,
GpuCholesky
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
from
theano.tensor.nnet
import
abstract_conv
from
tests
import
unittest_tools
as
utt
,
test_ifelse
from
tests.tensor
import
test_basic
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
def
_check_stack_trace
(
thing
):
def
_check_stack_trace
(
thing
):
...
...
tests/gpuarray/test_others.py
浏览文件 @
a3dbdec3
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
from
theano.misc.pkl_utils
import
dump
,
load
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
theano.gpuarray.basic_ops
import
HostFromGpu
,
GpuFromHost
from
tests.misc.test_may_share_memory
import
may_share_memory_core
from
tests.tensor
import
test_opt
from
theano.gpuarray.basic_ops
import
GpuFromHost
,
HostFromGpu
from
theano.gpuarray.type
import
(
from
theano.gpuarray.type
import
(
get_context
,
GpuArrayType
,
GpuArraySharedVariable
,
GpuArraySharedVariable
,
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
,
gpuarray_shared_constructor
,
)
)
from
theano.misc.pkl_utils
import
dump
,
load
from
tests.tensor
import
test_opt
from
tests.misc.test_may_share_memory
import
may_share_memory_core
from
tests.gpuarray.config
import
test_ctx_name
,
mode_with_gpu
class
TestFusion
(
test_opt
.
TestFusion
):
class
TestFusion
(
test_opt
.
TestFusion
):
...
...
tests/gpuarray/test_pickle.py
浏览文件 @
a3dbdec3
...
@@ -8,17 +8,15 @@ regular test file.
...
@@ -8,17 +8,15 @@ regular test file.
import
os
import
os
import
sys
import
sys
from
pickle
import
Unpickler
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
from
pickle
import
Unpickler
from
theano
import
config
from
theano
import
config
from
theano.gpuarray.type
import
ContextNotDefined
from
theano.gpuarray.type
import
ContextNotDefined
try
:
try
:
import
pygpu
# noqa: F401
import
pygpu
# noqa: F401
...
...
tests/gpuarray/test_pool.py
浏览文件 @
a3dbdec3
import
copy
import
copy
import
itertools
import
itertools
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
theano
from
tests
import
unittest_tools
as
utt
from
theano
import
gradient
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
theano
import
tensor
from
tests.gpuarray.test_basic_ops
import
rand
from
theano.tensor.signal.pool
import
(
from
theano
import
gradient
,
tensor
Pool
,
MaxPoolGrad
,
AveragePoolGrad
,
DownsampleFactorMaxGradGrad
,
)
from
theano.gpuarray.pool
import
(
from
theano.gpuarray.pool
import
(
GpuPool
,
GpuMaxPoolGrad
,
GpuAveragePoolGrad
,
GpuAveragePoolGrad
,
GpuDownsampleFactorMaxGradGrad
,
GpuDownsampleFactorMaxGradGrad
,
GpuMaxPoolGrad
,
GpuPool
,
)
from
theano.tensor.signal.pool
import
(
AveragePoolGrad
,
DownsampleFactorMaxGradGrad
,
MaxPoolGrad
,
Pool
,
)
)
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
tests.gpuarray.test_basic_ops
import
rand
class
TestPool
:
class
TestPool
:
...
...
tests/gpuarray/test_reduction.py
浏览文件 @
a3dbdec3
import
math
import
math
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
theano
import
theano.tensor
as
tt
import
theano.tensor
as
tt
from
theano.gpuarray
import
GpuArrayType
from
theano.gpuarray.reduction
import
GpuMaxAndArgmax
from
theano.gpuarray.dnn
import
GpuDnnReduction
from
tests
import
unittest_tools
as
utt
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
tests.gpuarray.config
import
mode_with_gpu
,
mode_without_gpu
from
tests.gpuarray.test_basic_ops
import
rand_gpuarray
from
tests.gpuarray.test_basic_ops
import
rand_gpuarray
from
theano.gpuarray
import
GpuArrayType
from
theano.gpuarray.dnn
import
GpuDnnReduction
from
theano.gpuarray.reduction
import
GpuMaxAndArgmax
# Number of values to be used in test tensors (except with 0-D tensors!).
# Number of values to be used in test tensors (except with 0-D tensors!).
...
...
tests/gpuarray/test_rng_mrg.py
浏览文件 @
a3dbdec3
...
@@ -3,17 +3,15 @@ import functools
...
@@ -3,17 +3,15 @@ import functools
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
from
theano
import
change_flags
,
tensor
from
theano.sandbox
import
rng_mrg
from
theano.sandbox.rng_mrg
import
MRG_RandomStreams
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
theano.gpuarray.rng_mrg
import
GPUA_mrg_uniform
from
tests
import
unittest_tools
as
utt
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
as
mode
from
tests.gpuarray.config
import
mode_with_gpu
as
mode
from
tests.sandbox.test_rng_mrg
import
java_samples
,
rng_mrg_overflow
from
tests.sandbox.test_rng_mrg
import
java_samples
,
rng_mrg_overflow
from
tests.sandbox.test_rng_mrg
import
test_f16_nonzero
as
cpu_f16_nonzero
from
tests.sandbox.test_rng_mrg
import
test_f16_nonzero
as
cpu_f16_nonzero
from
theano
import
change_flags
,
tensor
from
theano.gpuarray.rng_mrg
import
GPUA_mrg_uniform
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
theano.sandbox
import
rng_mrg
from
theano.sandbox.rng_mrg
import
MRG_RandomStreams
utt
.
seed_rng
()
utt
.
seed_rng
()
...
...
tests/gpuarray/test_scan.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
import
theano.sandbox.rng_mrg
import
theano.sandbox.rng_mrg
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
theano.gpuarray.basic_ops
import
GpuFromHost
,
HostFromGpu
from
theano.gpuarray.basic_ops
import
GpuFromHost
,
HostFromGpu
from
theano.gpuarray.elemwise
import
GpuElemwise
from
theano.gpuarray.elemwise
import
GpuElemwise
from
tests
import
unittest_tools
as
utt
class
TestScan
:
class
TestScan
:
def
setup_method
(
self
):
def
setup_method
(
self
):
...
...
tests/gpuarray/test_sort.py
浏览文件 @
a3dbdec3
from
theano.gpuarray.sort
import
GpuTopKOp
from
tests.tensor.test_sort
import
TestTopK
from
tests.gpuarray.config
import
mode_with_gpu
from
tests.gpuarray.config
import
mode_with_gpu
from
tests.tensor.test_sort
import
TestTopK
from
theano.gpuarray.sort
import
GpuTopKOp
class
TestGpuTopK
(
TestTopK
):
class
TestGpuTopK
(
TestTopK
):
...
...
tests/gpuarray/test_subtensor.py
浏览文件 @
a3dbdec3
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
from
tests
import
unittest_tools
as
utt
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
from
tests.tensor.test_basic
import
TestAllocDiag
from
tests.tensor.test_subtensor
import
TestAdvancedSubtensor
,
TestSubtensor
from
theano
import
tensor
from
theano
import
tensor
from
theano.compile
import
DeepCopyOp
from
theano.compile
import
DeepCopyOp
from
theano.gpuarray.basic_ops
import
HostFromGpu
,
GpuFromHost
,
GpuContiguous
from
theano.gpuarray.basic_ops
import
GpuContiguous
,
GpuFromHost
,
HostFromGpu
from
theano.gpuarray.elemwise
import
GpuDimShuffle
from
theano.gpuarray.elemwise
import
GpuDimShuffle
from
theano.gpuarray.subtensor
import
(
from
theano.gpuarray.subtensor
import
(
GpuIncSubtensor
,
GpuSubtensor
,
GpuAdvancedSubtensor1
,
GpuAdvancedSubtensor
,
GpuAdvancedIncSubtensor
,
GpuAdvancedIncSubtensor
,
GpuAdvancedIncSubtensor1
,
GpuAdvancedIncSubtensor1
,
GpuAdvancedIncSubtensor1_dev20
,
GpuAdvancedIncSubtensor1_dev20
,
GpuExtractDiag
,
GpuAdvancedSubtensor
,
GpuAdvancedSubtensor1
,
GpuAllocDiag
,
GpuAllocDiag
,
GpuExtractDiag
,
GpuIncSubtensor
,
GpuSubtensor
,
)
)
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
theano.gpuarray.type
import
gpuarray_shared_constructor
from
tests
import
unittest_tools
as
utt
from
tests.tensor.test_subtensor
import
TestSubtensor
,
TestAdvancedSubtensor
from
tests.tensor.test_basic
import
TestAllocDiag
from
tests.gpuarray.config
import
mode_with_gpu
,
test_ctx_name
class
TestGPUSubtensor
(
TestSubtensor
):
class
TestGPUSubtensor
(
TestSubtensor
):
def
setup_method
(
self
):
def
setup_method
(
self
):
...
...
tests/gpuarray/test_type.py
浏览文件 @
a3dbdec3
import
os
import
os
import
pytest
import
numpy
as
np
import
numpy
as
np
import
pytest
import
theano
import
theano
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
pygpu
=
pytest
.
importorskip
(
"pygpu"
)
from
pickle
import
Unpickler
from
pickle
import
Unpickler
from
tests.gpuarray.config
import
test_ctx_name
from
tests.gpuarray.test_basic_ops
import
rand_gpuarray
from
theano
import
config
from
theano
import
config
from
theano.compile
import
DeepCopyOp
,
Rebroadcast
,
ViewOp
from
theano.compile
import
DeepCopyOp
,
Rebroadcast
,
ViewOp
from
theano.gpuarray.type
import
GpuArrayType
,
gpuarray_shared_constructor
from
theano.gpuarray.type
import
GpuArrayType
,
gpuarray_shared_constructor
from
tests.gpuarray.config
import
test_ctx_name
from
tests.gpuarray.test_basic_ops
import
rand_gpuarray
# Disabled for now
# Disabled for now
# from tests.tensor.test_sharedvar import makeSharedTester
# from tests.tensor.test_sharedvar import makeSharedTester
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论