BaseTensor

Description

Defines the structure of tensor data.

Structure Definition

1
2
3
4
5
struct BaseTensor { 
     void* buf; 
     std::vector<int> shape; 
     size_t size; 
 }

Parameters

Parameter

Description

buf

Tensor data

shape

Tensor shape

size

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.