Function: get_dataset_tensor_desc

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

x

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 acl.mdl.set_dataset_tensor_desc to set the tensor description before the model is executed. After the model is executed, call acl.mdl.get_dataset_tensor_desc to obtain the tensor description of the dynamic output of the model.

Prototype

  • C Prototype
    1
    aclTensorDesc *aclmdlGetDatasetTensorDesc(const aclmdlDataset *dataset, size_t index)
    
  • Python Function
    1
    tensorDesc =acl.mdl.get_dataset_tensor_desc(dataset, index)
    

Parameters

Parameter

Description

dataset

Int, pointer address of the input or output data structure for model execution.

index

Int, input or output index.

When a model has multiple inputs and outputs, call acl.mdl.get_input_name_by_index or acl.mdl.get_output_name_by_index to obtain the input or output names and set the index accordingly.

Returns

Return Value

Description

tensor_desc

Int, pointer address of the tensor description of the specified input or output.