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