OP_CHECK_NULL_WITH_CONTEXT

Description

Checks if an input pointer is null based on the input context.

Prototype

OP_CHECK_NULL_WITH_CONTEXT(context, ptr)

Parameters

Parameter

Input/Output

Description

context

Input

Tiling context. The parameter type can be InferShapeContext, TilingParseContext, or TilingContext.

ptr

Input

Pointer to be checked.

Return Value

If the input pointer is null, ge::GRAPH_FAILED is returned.

Constraints

None.

Example

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

1
2
3
4
5
6
auto inShape = context->GetInputShape(0);
OP_CHECK_NULL_WITH_CONTEXT(context, inShape);
auto axesTensor = context->GetInputTensor(1);
OP_CHECK_NULL_WITH_CONTEXT(context, axesTensor);
auto outShape = context->GetOutputShape(0);
OP_CHECK_NULL_WITH_CONTEXT(context, outShape);