aclmdlSetDatasetTensorDesc

The Atlas 200/300/500 Inference Product does not support this API.

Description

Sets the tensor description of a dynamic-shape input or output before the model is executed.

Restrictions

For a single model, aclmdlSetDynamicBatchSize, aclmdlSetDynamicHWSize, aclmdlSetInputDynamicDims, and aclmdlSetDatasetTensorDesc are mutually exclusive.

Prototype

aclError aclmdlSetDatasetTensorDesc(aclmdlDataset *dataset, aclTensorDesc *tensorDesc, size_t index)

Parameters

Parameter

Input/Output

Description

dataset

Output

Pointer to the aclmdlDataset address where aclTensorDesc is added, indicating the input or output data structure for model execution.

Call aclmdlCreateDataset to create data of the aclmdlDataset type, and then call aclmdlAddDatasetBuffer to add aclDataBuffer to aclmdlDataset.

tensorDesc

Input

Pointer to the aclTensorDesc address, indicating the input or output tensor description for model execution.

Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance. In the model input or output tensor description, only the shape configurations take effect, which correspond to the numDims parameter that specifies the dimension count and the dims parameter that specifies the dimensions passed to the aclCreateTensorDesc call. The data type and format configurations are invalid.

The number of dimensions and dimension sizes must be within the range of the input shape set during model building.

index

Input

Input or output index.

When a model has multiple inputs and outputs, call aclmdlGetInputNameByIndex or aclmdlGetOutputNameByIndex to obtain the input or output names and set the index accordingly.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.

See Also

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