BaseTensor

Function

Defines the structure of tensor data.

Structure Definition

struct BaseTensor { 
     void* buf; 
     std::vector<int> shape; 
     size_t size; 
 }

Parameter Description

Parameter

Input/Output

Description

buf

Input

Tensor data

shape

Input

Tensor shape

size

Input

Memory size corresponding to the tensor data, in bytes.

The size must be the same as the actual memory size. Otherwise, a core dump may occur.