FilesLast commitLast update
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
29 days ago
16 days ago
README

VarIsInitializedOp

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

Checks whether a tensor (variable) has been initialized. The output is a bool scalar that indicates whether the input variable has been initialized: the input must be a Variable node. The graph engine queries the initialization state of the Variable through VarIsInitializedOpPass during compilation and rewrites this operator node into a constant output.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input The variable tensor to check (which must be the output of a Variable node). TensorType::ALL() ND
y Output A bool scalar that indicates whether the variable has been initialized (regardless of the input shape/dtype). TensorType({DT_BOOL}) ND

Constraint Description

  • This operator is an experimental feature (EXPERIMENTAL). Do not use it in the production environment.
  • The input must be a Variable node: the graph engine VarIsInitializedOpPass queries the initialization state of the Variable during compilation and rewrites this operator node.
  • The output is always a bool scalar, regardless of the shape and data type of the input.

Invocation Description

The VarIsInitializedOp operator is a basic graph engine operator, and usually works with Variable in the mode of Variable → VarIsInitializedOp to query the initialization state of a variable.

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