(self, ary, dtype=None, name=None, persist_values=True,
              parallel=False, distributed=False, allocator=drv.mem_alloc)
return GPUTensor(self, ary.shape, dtype=dtype, name=name,
                         persist_values=persist_values, allocator=allocator,
                         rounding=self.round_mode).set(ary)
Converts a numpy array to a GPUTensor

        Arguments:
            ary (numpy.ndarray): The data structure containing element values
                                 spread across a number of dimensions.  Python
                                 built-in types like ints and lists are
                                 supported.
            dtype (dtype, optional): Element data type.  If not specified we
                                     use default_dtype value ('float32'
                                     unless overridden).
            persist_values (bool, optional): If set to True (the default), the
                                             values assigned to this Tensor
                                             will persist across multiple begin
                                             and end calls.  Setting to False
                                             may provide a performance increase
                                             if values do not need to be
                                             maintained across such calls
            allocator (function, optional): Memory allocator.

        Returns:
            GPUTensor: newly created data structure reference
Converts a numpy array to a GPUTensor
Converts a numpy array to a GPUTensor
def array(self, ary, dtype=None, name=None, persist_values=True,
              parallel=False, distributed=False, allocator=drv.mem_alloc):
        """
        Converts a numpy array to a GPUTensor

        Arguments:
            ary (numpy.ndarray): The data structure containing element values
                                 spread across a number of dimensions.  Python
                                 built-in types like ints and lists are
                                 supported.
            dtype (dtype, optional): Element data type.  If not specified we
                                     use default_dtype value ('float32'
                                     unless overridden).
            persist_values (bool, optional): If set to True (the default), the
                                             values assigned to this Tensor
                                             will persist across multiple begin
                                             and end calls.  Setting to False
                                             may provide a performance increase
                                             if values do not need to be
                                             maintained across such calls
            allocator (function, optional): Memory allocator.

        Returns:
            GPUTensor: newly created data structure reference
        """
        dtype = self.default_dtype if dtype is None else dtype
        if ary.ndim < self._min_dims:
            ary = ary.reshape(ary.size, 1)
        return GPUTensor(self, ary.shape, dtype=dtype, name=name,
                         persist_values=persist_values, allocator=allocator,
                         rounding=self.round_mode).set(ary)
def array ( self , ary , dtype = None , name = None , persist_values = True , parallel = False , distributed = False , allocator = drv . mem_alloc ) : dtype = self . default_dtype if dtype is None else dtype if ary . ndim < self . _min_dims : ary = ary . reshape ( ary . size , 1 ) return GPUTensor ( self , ary . shape , dtype = dtype , name = name , persist_values = persist_values , allocator = allocator , rounding = self . round_mode ) . set ( ary )