tvm_tirx.runtime.Tensor

tvm_tirx.runtime.Tensor#

class tvm_tirx.runtime.Tensor#

Bases: Tensor

Lightweight Tensor class of TVM runtime.

Strictly this is only an Array Container (a buffer object) No arthimetic operations are defined. All operations are performed by TVM functions.

The goal is not to re-build yet another array library. Instead, this is a minimal data structure to demonstrate how can we use TVM in existing project which might have their own array containers.

copyfrom(source_array)#

Perform a synchronous copy from the array.

Parameters:

source_array (array_like) – The data source we should like to copy from.

Returns:

arr (Tensor) – Reference to self.

numpy()#

Convert this array to numpy array

Returns:

np_arr (numpy.ndarray) – The corresponding numpy array.

copyto(target, mem_scope=None)#

Copy array to target

Parameters: