Function: get_dataset_tensor_desc

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

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)
    

Parameter Description

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.

Return Value Description

Return Value

Description

tensor_desc

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