| Files | Last commit | Last update |
|---|---|---|
| 16 days ago | ||
| 25 days ago | ||
| 25 days ago | ||
| 25 days ago | ||
| 25 days ago | ||
| 25 days ago | ||
| 16 days ago |
RefMerge
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
RefMerge is a basic control flow operator. Its function is the same as Merge: it forwards the first tensor that becomes available in the input x to the output y, and gives the index of the tensor in the inputs in value_index. The difference is that RefMerge is used for reference (ref) type data. RefMerge usually works with the RefSwitch operator to converge branches.
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Dynamic input | Input tensors, one of which becomes available. All input tensors should use the same data type. Shape inference merges the dimension information of all inputs. | float16, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bool | ND |
| y | Output | The available tensor, whose data type is the same as that of x. | float16, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bool | ND |
| value_index | Output | A scalar, which is the index of the selected input tensor in the input list. | DT_INT32 | ND |
Constraint Description
- The number of inputs
xmust be greater than or equal to 1. Otherwise, shape inference fails. - The data types of all inputs
xmust be the same. Data type inference checks the type of each input one by one, and returns a failure if the types are inconsistent. The data type of the outputyis the same as that of the inputs, andvalue_indexisDT_INT32. - If the numbers of dimensions of the inputs
xare inconsistent or an input of unknown rank exists, the outputyis inferred as unknown rank ([-2]), and inference does not fail due to inconsistent ranks. - For a dimension, if the values of the inputs are inconsistent or an unknown dimension (-1) exists, the dimension is inferred as -1 (unknown).
Invocation Description
The RefMerge operator is a basic control flow operator. It is usually used as a branch convergence node in a graph, and is not invoked separately.
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| Graph-mode invocation | test_geir_ref_merge | Invokes the RefMerge operator by building a graph through the operator IR. |