RefEnter
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
Creates or finds a child frame, and makes the input tensor x, which can be overwritten by references, available in the child frame. The RefEnter operator works with the Exit operator to create loops in a graph, and identifies a frame through the unique frame_name attribute. When is_constant is true, the output tensor y is constant in the child frame; otherwise, it may be changed in the child frame. Unlike the Enter operator, the input of RefEnter can be overwritten by ref-type operators and serves as a variable.
Parameter Description
| Parameter Name |
Input/Output/Attribute |
Description |
Data Type |
Data Format |
| x |
Input |
Input tensor. A tensor that can be overwritten by references and needs to be available in the child frame. |
float16, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bool |
ND |
| frame_name |
Attribute |
Name of the child frame. A frame is identified by this unique name. |
String, required |
- |
| is_constant |
Attribute |
If true, the output is constant in the child frame; otherwise, it may be changed in the child frame. |
Bool, required |
- |
| y |
Output |
Tensor that has the same shape and data type as the input tensor x. |
float16, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bool |
ND |
Constraint Description
- frame_name and is_constant are required attributes.
- The data type and shape of the output tensor y must be the same as those of the input tensor x.
Invocation Description
The RefEnter operator is a control flow operator. It usually works with the Exit operator to create loops in a graph, and is not invoked separately.
| Invocation Method |
Invocation Sample |
Description |
| Graph-mode invocation |
test_geir_ref_enter |
Invokes the RefEnter operator by building a graph through the operator IR. |