FilesLast commitLast update
2 months ago
13 days ago
14 days ago
3 months ago
7 days ago
18 days ago
26 days ago
5 days ago
README

GetShape

English | 简体中文

Product Support Status

Product Supported
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products ×
Atlas inference products √
Atlas training products √

Function Description

  • Operator function: obtains the shape information of one or more input tensors, and concatenates the size values of all dimensions in the input order into a one-dimensional int32 tensor output.

  • Computation logic:

    • N tensors are input, and the rank of the i-th tensor is r_i
    • The output is a one-dimensional int32 tensor with a length of sum(r_i), and its content is the sequential concatenation of the dimension values of all input tensors
  • Example:

    Input: x0 = float32[2, 3, 4], x1 = float32[5, 6]
    Output: y = int32[5] = [2, 3, 4, 5, 6]
    

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Dynamic input List of input tensors for obtaining shape information. DOUBLE, FLOAT, FLOAT16, INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, BOOL ND
y Output Sequential concatenation of the dimension values of all input tensors. The length is the sum of the ranks of all inputs. INT32 ND

Constraint Description

  • The rank of each input tensor does not exceed 8.
  • The sum of the ranks of all input tensors (that is, the output length) does not exceed 128 and is greater than 0 (all inputs cannot be scalars).
  • The output dtype is fixed to INT32 and cannot be configured.
  • Only the ND format is supported for inputs.

Invocation Description

Invocation Method Invocation Sample Description
Graph-mode invocation test_geir_get_shape Invokes the GetShape operator by building a graph through the operator IR.