提交 3889293c authored 作者: lamblin's avatar lamblin

Merge pull request #1476 from nouiz/cleanup

Cleanup
...@@ -9,7 +9,7 @@ import numpy ...@@ -9,7 +9,7 @@ import numpy
import theano import theano
from theano import scalar as scal from theano import scalar as scal
from theano import tensor, gof from theano import config, tensor, gof
import theano.ifelse import theano.ifelse
from theano.compile import optdb from theano.compile import optdb
...@@ -17,7 +17,13 @@ from theano.gof import (local_optimizer, EquilibriumDB, SequenceDB, ProxyDB, ...@@ -17,7 +17,13 @@ from theano.gof import (local_optimizer, EquilibriumDB, SequenceDB, ProxyDB,
Optimizer, toolbox, DestroyHandler, Optimizer, toolbox, DestroyHandler,
EquilibriumOptimizer) EquilibriumOptimizer)
from theano.gof.python25 import all, any from theano.gof.python25 import all, any
from theano.sandbox.cuda.basic_ops import * from theano.sandbox.cuda.basic_ops import (
device_properties, gpu_eye,
gpu_from_host, host_from_gpu, HostFromGpu,
GpuElemwise, GpuDimShuffle, GpuReshape, GpuCAReduce, GpuFlatten,
GpuSubtensor, GpuAdvancedSubtensor1,
GpuAdvancedIncSubtensor1, GpuAdvancedIncSubtensor1_dev20,
GpuIncSubtensor, gpu_alloc, GpuAlloc, gpu_shape)
from theano.sandbox.cuda.type import CudaNdarrayType from theano.sandbox.cuda.type import CudaNdarrayType
from theano.sandbox.cuda.blas import (gpu_dot22, gpu_dot22scalar, from theano.sandbox.cuda.blas import (gpu_dot22, gpu_dot22scalar,
gpu_gemm_inplace, gpu_gemm_no_inplace, GpuConv) gpu_gemm_inplace, gpu_gemm_no_inplace, GpuConv)
...@@ -102,7 +108,7 @@ class InputToGpuOptimizer(Optimizer): ...@@ -102,7 +108,7 @@ class InputToGpuOptimizer(Optimizer):
if new_input.type == input.type: if new_input.type == input.type:
fgraph.replace_validate(input, new_input, fgraph.replace_validate(input, new_input,
"InputToGpuOptimizer") "InputToGpuOptimizer")
except TypeError, e: except TypeError:
#as we currently only support float32, this can fail. #as we currently only support float32, this can fail.
#Using try except make that we won't need #Using try except make that we won't need
pass pass
...@@ -662,9 +668,6 @@ def local_gpu_careduce(node): ...@@ -662,9 +668,6 @@ def local_gpu_careduce(node):
"WARNING: local_gpu_careduce got type wrong" "WARNING: local_gpu_careduce got type wrong"
return None return None
raise Exception(
"GpuCAReduce does not yet implement this pattern:",
pattern)
return False return False
...@@ -1217,7 +1220,8 @@ def get_device_type_sizes(): ...@@ -1217,7 +1220,8 @@ def get_device_type_sizes():
int_size = 8 int_size = 8
try: try:
t = cuda_ndarray.cuda_ndarray.ptr_int_size() cuda_ndarray = theano.sandbox.cuda.cuda_ndarray.cuda_ndarray
t = cuda_ndarray.ptr_int_size()
gpu_ptr_size, cpu_ptr_size, int_size, gpu_int_size = t gpu_ptr_size, cpu_ptr_size, int_size, gpu_int_size = t
assert int_size == gpu_int_size assert int_size == gpu_int_size
del gpu_int_size del gpu_int_size
......
import copy
import sys
import time import time
import unittest import unittest
...@@ -9,7 +7,6 @@ from theano import tensor ...@@ -9,7 +7,6 @@ from theano import tensor
import numpy import numpy
import theano import theano
import theano.tensor as T import theano.tensor as T
from numpy.testing.noseclasses import KnownFailureTest
# Skip test if cuda_ndarray is not available. # Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
...@@ -1255,7 +1252,4 @@ def speed_adv_sub1(): ...@@ -1255,7 +1252,4 @@ def speed_adv_sub1():
if __name__ == '__main__': if __name__ == '__main__':
test_many_arg_elemwise() test_many_arg_elemwise()
test_gpujoin_twomatrices_joincolumns()
test_gpujoin_assert_cndas() test_gpujoin_assert_cndas()
test_gpujoin_preserves_broadcasting()
test_gpujoin_twomatrices_badshapes()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论