(self, axes=None)
return GPUArray(
            shape=tuple(new_shape),
            dtype=self.dtype,
            allocator=self.allocator,
            base=self.base or self,
            gpudata=self.gpudata,
            strides=tuple(new_strides),
        )
Permute the dimensions of an array.

        :arg axes: list of ints, optional.
            By default, reverse the dimensions, otherwise permute the axes
            according to the values given.

        :returns: :class:`GPUArray` A view of the array with its axes permuted.

        .. versionadded:: 2015.2
Permute the dimensions of an array.
Permute the dimensions of an array .
def transpose(self, axes=None):
        """Permute the dimensions of an array.

        :arg axes: list of ints, optional.
            By default, reverse the dimensions, otherwise permute the axes
            according to the values given.

        :returns: :class:`GPUArray` A view of the array with its axes permuted.

        .. versionadded:: 2015.2
        """

        if axes is None:
            axes = range(self.ndim - 1, -1, -1)
        if len(axes) != len(self.shape):
            raise ValueError("axes don't match array")
        new_shape = [self.shape[axes[i]] for i in range(len(axes))]
        new_strides = [self.strides[axes[i]] for i in range(len(axes))]
        return GPUArray(
            shape=tuple(new_shape),
            dtype=self.dtype,
            allocator=self.allocator,
            base=self.base or self,
            gpudata=self.gpudata,
            strides=tuple(new_strides),
        )
def transpose ( self , axes = None ) : if axes is None : axes = range ( self . ndim - 1 , - 1 , - 1 ) if len ( axes ) != len ( self . shape ) : raise ValueError ( "axes don't match array" ) new_shape = [ self . shape [ axes [ i ] ] for i in range ( len ( axes ) ) ] new_strides = [ self . strides [ axes [ i ] ] for i in range ( len ( axes ) ) ] return GPUArray ( shape = tuple ( new_shape ) , dtype = self . dtype , allocator = self . allocator , base = self . base or self , gpudata = self . gpudata , strides = tuple ( new_strides ) , )