提交 fe380388 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Use relative import for things that come from this module.

上级 6a732dd7
...@@ -26,9 +26,9 @@ AddConfigVar('gpuarray.sync', ...@@ -26,9 +26,9 @@ AddConfigVar('gpuarray.sync',
in_c_key=True) in_c_key=True)
# This is for documentation not to depend on the availability of pygpu # This is for documentation not to depend on the availability of pygpu
from type import (GpuArrayType, GpuArrayVariable, GpuArrayConstant, from .type import (GpuArrayType, GpuArrayVariable, GpuArrayConstant,
GpuArraySharedVariable, gpuarray_shared_constructor) GpuArraySharedVariable, gpuarray_shared_constructor)
import opt from . import opt
def init_dev(dev): def init_dev(dev):
......
...@@ -20,7 +20,7 @@ try: ...@@ -20,7 +20,7 @@ try:
except ImportError: except ImportError:
pass pass
from type import GpuArrayType from .type import GpuArrayType
def as_gpuarray_variable(x): def as_gpuarray_variable(x):
......
from theano import Op, Apply, config from theano import Op, Apply, config
from theano.tensor.blas import Dot22, Gemv, Gemm, Ger from theano.tensor.blas import Dot22, Gemv, Gemm, Ger
from theano.sandbox.gpuarray.basic_ops import (HideC, as_gpuarray_variable) from .basic_ops import HideC, as_gpuarray_variable
try: try:
import pygpu import pygpu
......
...@@ -3,9 +3,9 @@ import os ...@@ -3,9 +3,9 @@ import os
import theano import theano
from theano import config, gof from theano import config, gof
from theano.sandbox.gpuarray.comp import NVCC_compiler from .comp import NVCC_compiler
from theano.sandbox.gpuarray.type import GpuArrayType from .type import GpuArrayType
from theano.sandbox.gpuarray.basic_ops import as_gpuarray_variable from .basic_ops import as_gpuarray_variable
class GpuConv(gof.Op): class GpuConv(gof.Op):
......
...@@ -7,9 +7,9 @@ import numpy ...@@ -7,9 +7,9 @@ import numpy
import theano import theano
from theano import Apply, scalar, config from theano import Apply, scalar, config
from theano import scalar as scal from theano import scalar as scal
from theano.gof.utils import MethodNotDefined
from theano.scalar import Scalar from theano.scalar import Scalar
from theano.tensor.elemwise import (Elemwise, DimShuffle, CAReduceDtype) from theano.tensor.elemwise import (Elemwise, DimShuffle, CAReduceDtype)
from theano.sandbox.gpuarray.comp import NVCC_compiler
try: try:
import pygpu import pygpu
...@@ -21,11 +21,11 @@ try: ...@@ -21,11 +21,11 @@ try:
except ImportError: except ImportError:
pass pass
from theano.sandbox.gpuarray.basic_ops import (as_gpuarray_variable, HideC, from .basic_ops import (as_gpuarray_variable, HideC,
GpuKernelBase, Kernel) GpuKernelBase, Kernel)
from theano.sandbox.gpuarray.type import GpuArrayType from .comp import NVCC_compiler
from .type import GpuArrayType
from theano.gof.utils import MethodNotDefined
def _is_scalar(v): def _is_scalar(v):
......
""" Helper routines for generating gpu kernels for nvcc. """ Helper routines for generating gpu kernels for nvcc.
""" """
def nvcc_kernel(name, params, body): def nvcc_kernel(name, params, body):
"""Return the c code of a kernel function. """Return the c code of a kernel function.
......
...@@ -11,12 +11,11 @@ try: ...@@ -11,12 +11,11 @@ try:
except ImportError: except ImportError:
pass pass
from theano.sandbox.gpuarray.basic_ops import (as_gpuarray_variable, from .basic_ops import (as_gpuarray_variable,
host_from_gpu, gpu_from_host) host_from_gpu, gpu_from_host)
from theano.sandbox.gpuarray.opt import register_opt as register_gpu_opt from .opt import register_opt as register_gpu_opt, op_lifter
from theano.sandbox.gpuarray.opt import op_lifter as op_lifter from .type import GpuArrayType
from theano.sandbox.gpuarray.type import GpuArrayType from .comp import NVCC_compiler
from theano.sandbox.gpuarray.comp import NVCC_compiler
class GpuImages2Neibs(Images2Neibs, Op): class GpuImages2Neibs(Images2Neibs, Op):
......
...@@ -2,8 +2,6 @@ import numpy ...@@ -2,8 +2,6 @@ import numpy
from theano import Op, Apply, config from theano import Op, Apply, config
from theano.compat.six import StringIO from theano.compat.six import StringIO
from theano.sandbox.gpuarray.comp import NVCC_compiler
try: try:
import pygpu import pygpu
...@@ -11,9 +9,10 @@ try: ...@@ -11,9 +9,10 @@ try:
except ImportError: except ImportError:
pass pass
from theano.sandbox.gpuarray.basic_ops import as_gpuarray_variable from .basic_ops import as_gpuarray_variable
from theano.sandbox.gpuarray.type import GpuArrayType from .comp import NVCC_compiler
from theano.sandbox.gpuarray.kernel_codegen import (nvcc_kernel, from .type import GpuArrayType
from .kernel_codegen import (nvcc_kernel,
inline_softmax, inline_softmax,
inline_softmax_fixed_shared) inline_softmax_fixed_shared)
......
...@@ -18,26 +18,23 @@ from theano.scan_module import scan_utils, scan_op, scan_opt ...@@ -18,26 +18,23 @@ from theano.scan_module import scan_utils, scan_op, scan_opt
from theano.compat.python2x import all, any from theano.compat.python2x import all, any
from theano.tensor.nnet.conv import ConvOp from theano.tensor.nnet.conv import ConvOp
from theano.sandbox.gpuarray.type import GpuArrayType from .type import GpuArrayType, GpuArrayConstant
from theano.sandbox.gpuarray.basic_ops import ( from .basic_ops import (host_from_gpu, gpu_from_host,
host_from_gpu, gpu_from_host, HostFromGpu, GpuFromHost, HostFromGpu, GpuFromHost,
GpuSplit, GpuSplit,
gpu_alloc, GpuAlloc, GpuReshape, GpuEye, gpu_join, GpuJoin, gpu_alloc, GpuAlloc, GpuReshape,
) GpuEye, gpu_join, GpuJoin)
from theano.sandbox.gpuarray.blas import gpu_dot22, GpuGemv, GpuGemm, GpuGer from .blas import gpu_dot22, GpuGemv, GpuGemm, GpuGer
from theano.sandbox.gpuarray.conv import GpuConv from .conv import GpuConv
from theano.sandbox.gpuarray.nnet import ( from .nnet import (GpuCrossentropySoftmaxArgmax1HotWithBias,
GpuCrossentropySoftmaxArgmax1HotWithBias,
GpuCrossentropySoftmax1HotWithBiasDx, GpuCrossentropySoftmax1HotWithBiasDx,
GpuSoftmaxWithBias, GpuSoftmax GpuSoftmaxWithBias, GpuSoftmax)
) from .elemwise import (GpuElemwise, _is_scalar,
from theano.sandbox.gpuarray.elemwise import (GpuElemwise, _is_scalar,
GpuDimShuffle, GpuCAReduceCuda, GpuDimShuffle, GpuCAReduceCuda,
GpuCAReduceCPY) GpuCAReduceCPY)
from theano.sandbox.gpuarray.subtensor import (GpuIncSubtensor, GpuSubtensor, from .subtensor import (GpuIncSubtensor, GpuSubtensor,
GpuAdvancedIncSubtensor1, GpuAdvancedIncSubtensor1,
GpuAdvancedIncSubtensor1_dev20) GpuAdvancedIncSubtensor1_dev20)
from theano.sandbox.gpuarray.type import GpuArrayConstant
gpu_optimizer = EquilibriumDB() gpu_optimizer = EquilibriumDB()
gpu_cut_copies = EquilibriumDB() gpu_cut_copies = EquilibriumDB()
......
...@@ -14,10 +14,10 @@ try: ...@@ -14,10 +14,10 @@ try:
except ImportError: except ImportError:
pass pass
from theano.sandbox.gpuarray.type import GpuArrayType from .type import GpuArrayType
from theano.sandbox.gpuarray.basic_ops import as_gpuarray_variable, HideC from .basic_ops import as_gpuarray_variable, HideC
from theano.sandbox.gpuarray.elemwise import GpuElemwise from .elemwise import GpuElemwise
from theano.sandbox.gpuarray.comp import NVCC_compiler from .comp import NVCC_compiler
class GpuSubtensor(HideC, Subtensor): class GpuSubtensor(HideC, Subtensor):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论