IsUnknownShape

Description

Checks if each dimension length of an input shape is unknown.

Prototype

bool IsUnknownShape(const gert::Shape &shape)

Parameters

Parameter

Input/Output

Description

shape

Input

Input shape to be checked.

Return Value

Return type: bool

  • true: Each dimension length of the input shape is unknown.
  • false: At least one dimension length of the input shape is known.

Constraints

None.

Example

The following sample code is for reference only. Do not copy and run it.

1
2
3
4
5
const gert::Shape* inputShape = context->GetInputShape(DIAGFLAT_IN_X_IDX);
OP_CHECK_NULL_WITH_CONTEXT(context, inputShape);
if (Ops::Base::IsUnknownShape(*inputShape)) {
    output_y_shape->SetDimNum(input_dim_num);
}