Module Import alias ImportFrom alias If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Str orelse Assign NameStore Num Assign NameStore NameLoad For NameStore Call NameLoad BinOpSub AttributeLoad NameLoad attr Num Num Num body If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Num body Continue If CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad body Assign NameStore NameLoad Break AugAssignMult NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If UnaryOpNot NameLoad body If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr orelse Raise Call NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad Str orelse If CompareNotEq AttributeLoad NameLoad attr Str body Raise Call NameLoad Str orelse Assign NameStore ListLoad Num For NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Slice Num body Expr Call AttributeLoad NameLoad attr BinOpMult SubscriptLoad NameLoad Index Num NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list
N/A N/A pycuda.gpuarray theano.sandbox cuda N/A N/A N/A cuda cuda_available False N/A N/A N/A ImportError Optional theano package cuda disabled to_gpuarray N/A N/A x copyif N/A False N/A N/A  take a CudaNdarray and return a pycuda.gpuarray.GPUArray

    :type x: CudaNdarray
    :param x: The array to transform to pycuda.gpuarray.GPUArray.
    :type copyif: bool
    :param copyif: If False, raise an error if x is not c contiguous.
                   If it is c contiguous, we return a GPUArray that share
                   the same memory region as x.
                   If True, copy x if it is no c contiguous, so the return won't
                   shape the same memory region. If c contiguous, the return
                   will share the same memory region.

                   We need to do this as GPUArray don't fully support strided memory.

    :return type: pycuda.gpuarray.GPUArray
     N/A N/A N/A isinstance x N/A cuda CudaNdarray N/A N/A N/A ValueError We can transfer only CudaNdarray to pycuda.gpuarray.GPUArray N/A N/A size 1 N/A c_contiguous True N/A i N/A range N/A N/A x ndim 1 -1 -1 N/A N/A N/A N/A N/A x shape N/A i 1 N/A N/A N/A N/A N/A N/A x _strides N/A i size N/A N/A c_contiguous False N/A N/A size N/A N/A x shape N/A i N/A N/A c_contiguous N/A N/A copyif N/A N/A x N/A N/A x copy N/A N/A N/A ValueError We were asked to not copy memory, but the memory is not c contiguous. N/A px N/A N/A N/A pycuda gpuarray GPUArray N/A x shape N/A x dtype base x gpudata N/A x gpudata N/A px N/A to_cudandarray N/A N/A x N/A N/A N/A  take a pycuda.gpuarray.GPUArray and make a CudaNdarray that point to its memory

    :note: CudaNdarray support only float32, so only float32 GPUArray are accepted
     N/A N/A N/A isinstance x N/A N/A pycuda gpuarray GPUArray N/A N/A N/A ValueError We can transfer only pycuda.gpuarray.GPUArray to CudaNdarray N/A N/A N/A N/A x dtype float32 N/A N/A N/A ValueError CudaNdarray support only float32 N/A N/A strides N/A 1 N/A i N/A N/A N/A x shape N/A -1 N/A -1 N/A N/A N/A N/A strides append N/A N/A strides N/A -1 i N/A strides N/A tuple N/A strides N/A -1 N/A ptr N/A int N/A x gpudata N/A z N/A N/A cuda from_gpu_pointer ptr N/A x shape strides x N/A z N/A