(self, *shape)
return self.__class__(
            backend=self.backend,
            shape=shape,
            dtype=self.dtype,
            allocator=self.allocator,
            base=self,
            gpudata=self.gpudata,
            strides=new_strides,
            name=self.name,
            rounding=self.rounding)
Return a reshaped view.
Return a reshaped view.
Return a reshaped view .
def reshape(self, *shape):
        """
        Return a reshaped view.
        """
        if isinstance(shape[0], (tuple, list)):
            shape = tuple(shape[0])

        if len(shape) < self._min_dims:
            shape = shape + (1, )

        if -1 in shape:
            missing_dim = -self.size // int(np.prod(shape))
            shape = tuple([missing_dim if x == -1 else x for x in shape])

        if shape == self.shape:
            return self

        size = np.prod(shape)

        if size != self.size:
            raise ValueError("total size of new array must be unchanged")

        if self.take_array:
            raise TypeError("reshaping of non-contiguous arrays is not yet supported")

        new_strides = _reshape_strides(self.strides, self.shape, shape)

        return self.__class__(
            backend=self.backend,
            shape=shape,
            dtype=self.dtype,
            allocator=self.allocator,
            base=self,
            gpudata=self.gpudata,
            strides=new_strides,
            name=self.name,
            rounding=self.rounding)
def reshape ( self , * shape ) : if isinstance ( shape [ 0 ] , ( tuple , list ) ) : shape = tuple ( shape [ 0 ] ) if len ( shape ) < self . _min_dims : shape = shape + ( 1 , ) if - 1 in shape : missing_dim = - self . size // int ( np . prod ( shape ) ) shape = tuple ( [ missing_dim if x == - 1 else x for x in shape ] ) if shape == self . shape : return self size = np . prod ( shape ) if size != self . size : raise ValueError ( "total size of new array must be unchanged" ) if self . take_array : raise TypeError ( "reshaping of non-contiguous arrays is not yet supported" ) new_strides = _reshape_strides ( self . strides , self . shape , shape ) return self . __class__ ( backend = self . backend , shape = shape , dtype = self . dtype , allocator = self . allocator , base = self , gpudata = self . gpudata , strides = new_strides , name = self . name , rounding = self . rounding )