Function: set_dataset_tensor_desc
C Prototype |
aclError aclmdlSetDatasetTensorDesc(aclmdlDataset *dataset, aclTensorDesc *tensorDesc, size_t index) |
|---|---|
Python Function |
dataset, ret = acl.mdl.set_dataset_tensor_desc(dataset, tensorDesc, index) |
Function Usage |
Sets the tensor description of the dynamic-shape model input or output before the model is executed. The Atlas 200/300/500 Inference Product does not support this API. |
Input Description |
dataset: int, address of aclmdlDataset to be added with aclTensorDesc, indicating the input or output data structure for model execution. Call acl.mdl.create_dataset to create data of the aclmdlDataset type, and then call acl.mdl.add_dataset_buffer to add aclDataBuffer to aclmdlDataset. tensorDesc: int, address of aclTensorDesc, indicating the input or output tensor description for model execution. Call acl.create_tensor_desc to create data of the aclTensorDesc type. 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 dimension sizes passed to the acl.create_tensor_desc call. The data type and format configurations are invalid. The configured dimension count and sizes must be within the shape range specified at model build. For details, see the model build section. index: int, input or output index. When a model has multiple inputs and outputs, call acl.mdl.get_input_name_by_index and acl.mdl.get_output_name_by_index to obtain the input or output names and set the index accordingly. |
Return Value |
dataset: int, address of aclmdlDataset to be added with aclTensorDesc, indicating the input or output data structure for model execution. ret: int, error code.
|
Restrictions |
For a single model, acl.mdl.set_dynamic_batch_size, acl.mdl.set_dynamic_hw_size, acl.mdl.set_input_dynamic_dims, and acl.mdl.set_dataset_tensor_desc are mutually exclusive. |