Tensor
Description
Defines an ATB tensor, including the descriptor, NPU memory address, CPU memory address, and memory size of each tensor.
Definition
1 2 3 4 5 6 | struct Tensor { TensorDesc desc; void *deviceData = nullptr; void *hostData = nullptr; uint64_t dataSize = 0; }; |
Parameters
Member |
Data Type |
Default Value |
Description |
|---|---|---|---|
desc |
TensorDesc |
- |
Tensor description |
deviceData |
void * |
nullptr |
Memory address of the tensor NPU |
hostData |
void * |
nullptr |
Memory address of the tensor CPU |
dataSize |
uint64_t |
0 |
Memory size of the content pointed to by deviceData or hostData |
Parent topic: atb/types.h