Function: get_tensor_desc_by_index

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

Function Usage

Obtains a tensor description based on the specified index of an operator.

Prototype

  • C Prototype
    1
    aclTensorDesc *aclGetTensorDescByIndex(aclTensorDesc *desc, size_t index)
    
  • Python Function
    1
    tensor_desc = acl.get_tensor_desc_by_index(desc, index)
    

Parameter Description

Parameter

Description

desc

Int, pointer address of the tensor description data.

Call acl.mdl.create_and_get_op_desc to obtain the tensor description of all inputs or all outputs of the operator.

index

Int, sequence number of the dimension whose size is to be obtained, starting from 0.

Value range: [0, Operator input or output count – 1]. Call acl.mdl.create_and_get_op_desc to obtain the operator input or output count.

Return Value Description

Return Value

Description

tensor_desc

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