IsVariableInitialized
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 is initialized. The IsVariableInitialized operator receives the input tensor x and outputs the scalar Boolean value y, indicating whether the input tensor is initialized. InferShape sets the output shape to a scalar (0-dimensional), and InferDataType sets the output data type to DT_BOOL.
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | Input tensor. | TensorType::ALL() | ND |
| y | Output | Scalar Boolean tensor, indicating whether the input tensor is initialized. Its shape is a scalar (0-dimensional), and its data type is DT_BOOL. | TensorType({DT_BOOL}) | ND |
Constraint Description
- The output y is a scalar (0-dimensional tensor), and its data type is fixed to DT_BOOL.
Invocation Description
The IsVariableInitialized operator is a basic operator of the graph engine. It is usually used to check whether a variable is initialized and is not invoked separately.
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| Graph-mode invocation | test_geir_is_variable_initialized | Invokes the IsVariableInitialized operator by building a graph through the operator IR |