aclmdlGetDatasetTensorDesc

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

Atlas training product

Function Usage

Obtains the tensor description of the specified input or output from the data of the aclmdlDataset type (used to describe the input and output data during model inference) after the model is executed if the input or output shape of a model is dynamic.

Typical scenario: If the input shape of a model is dynamic, call aclmdlSetDatasetTensorDesc to set the tensor description before the model is executed. After the model is executed, call aclmdlGetDatasetTensorDesc to obtain the tensor description of the dynamic output of the model.

Prototype

1
aclTensorDesc *aclmdlGetDatasetTensorDesc(const aclmdlDataset *dataset, size_t index)

Parameters

Parameter

Input/Output

Description

dataset

Input

Pointer to the input or output data for model execution.

Call aclmdlCreateDataset to create data of the aclmdlDataset type in advance.

index

Input

Input or output index.

When a model has multiple inputs and outputs, you can call aclmdlGetInputNameByIndex and aclmdlGetOutputNameByIndex to obtain the input and output names and set the names based on their indexes to avoid index errors.

Returns

Tensor description of the specified input or output. The type is aclTensorDesc.

Reference

For the API call example, see Dynamic Shape Input (Setting the Shape Range).