Tensor information.
| Member Name | Description |
|---|---|
validShape |
|
alignedShape |
|
tensorLayout |
|
tensorType |
|
shift |
|
scale |
|
quantiType |
|
quantizeAxis |
|
alignedByteSize |
|
stride |
|
If some dimensions in the validShape field are -1, it means that the validShape of the model is a dynamic input in this dimension, and you need to fill it in according to the actual input before creating a task.
The tensorLayout is compatible with J5, which is deprecated in J6.
The alignedShape is compatible with J5, which is not recommended for J6, using stride is recommended for aligning sizes.
The quantizeAxis represents the dimension of the quantization axis index and is only effective during per-axis quantization.
When the data is quantized with per-tensor, quantizeAxis is negative.
The tensor information obtained through the interface is required by the model, you can modify the corresponding tensor information according to the actual input, at present,
you are only allowed to modify the information of stride and tensorType, and must meet the requirements.
stride:
If you prepare your input based on stride, you do not need to modify the stride.
If you prepare your input based on validShape, you need to modify the value of stride to be the step size of the jumps in each dimension of validShape, and the inference library will internally padding the data.
If some dimensions of the stride obtained from the model are -1, it means that the stride of the model is a dynamic input in this dimension, and you need to fill it in according to the actual input before creating a task. For the constraints of filling in, please refer to the Dynamic Input Introduction section.
tensorType:
When inferring the model with NV12 input, you can modify the tensorType of the tensor to HB_DNN_IMG_TYPE_NV12 or HB_DNN_IMG_TYPE_NV12_SEPARATE based on the actual situation.
The alignedByteSize represents the size of the memory space occupied in the tensor, which can generally be used to apply for input and output memory.