Identity#
Identity - 16#
Version
name: Identity (GitHub)
domain: main
since_version: 16
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 16.
Summary
Identity operator
Inputs
input (heterogeneous) - V: Input tensor
Outputs
output (heterogeneous) - V: Tensor to copy input into.
Type Constraints
V in ( optional(seq(tensor(bool))), optional(seq(tensor(complex128))), optional(seq(tensor(complex64))), optional(seq(tensor(double))), optional(seq(tensor(float))), optional(seq(tensor(float16))), optional(seq(tensor(int16))), optional(seq(tensor(int32))), optional(seq(tensor(int64))), optional(seq(tensor(int8))), optional(seq(tensor(string))), optional(seq(tensor(uint16))), optional(seq(tensor(uint32))), optional(seq(tensor(uint64))), optional(seq(tensor(uint8))), optional(tensor(bool)), optional(tensor(complex128)), optional(tensor(complex64)), optional(tensor(double)), optional(tensor(float)), optional(tensor(float16)), optional(tensor(int16)), optional(tensor(int32)), optional(tensor(int64)), optional(tensor(int8)), optional(tensor(string)), optional(tensor(uint16)), optional(tensor(uint32)), optional(tensor(uint64)), optional(tensor(uint8)), seq(tensor(bool)), seq(tensor(complex128)), seq(tensor(complex64)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(string)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)), tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor, sequence, and optional types.
Examples
sequence
node = onnx.helper.make_node(
'Identity',
inputs=['x'],
outputs=['y'],
)
data = [
np.array([[[
[1, 2],
[3, 4],
]]], dtype=np.float32),
np.array([[[
[2, 3],
[1, 5],
]]], dtype=np.float32)]
expect(node, inputs=[data], outputs=[data], name='test_identity_sequence')
identity_opt
ten_in_tp = onnx.helper.make_tensor_type_proto(onnx.TensorProto.FLOAT, shape=[5])
seq_in_tp = onnx.helper.make_sequence_type_proto(ten_in_tp)
opt_in_tp = onnx.helper.make_optional_type_proto(seq_in_tp)
identity_node = onnx.helper.make_node(
'Identity',
inputs=['opt_in'],
outputs=['opt_out']
)
x = [np.array([1, 2, 3, 4, 5]).astype(np.float32)]
expect(identity_node, inputs=[x], outputs=[x], name='test_identity_opt',
opset_imports=[onnx.helper.make_opsetid("", 16)],
input_type_protos=[opt_in_tp],
output_type_protos=[opt_in_tp])
Differences
0 | 0 | Identity operator | Identity operator |
1 | 1 |
|
|
2 | 2 | **Inputs** | **Inputs** |
3 | 3 |
|
|
4 | 4 | * **input** (heterogeneous) - **V**: | * **input** (heterogeneous) - **V**: |
5 | 5 | Input tensor | Input tensor |
6 | 6 |
|
|
7 | 7 | **Outputs** | **Outputs** |
8 | 8 |
|
|
9 | 9 | * **output** (heterogeneous) - **V**: | * **output** (heterogeneous) - **V**: |
10 | 10 | Tensor to copy input into. | Tensor to copy input into. |
11 | 11 |
|
|
12 | 12 | **Type Constraints** | **Type Constraints** |
13 | 13 |
|
|
14 | 14 | * **V** in ( | * **V** in ( |
15 | optional(seq(tensor(bool))), | ||
16 | optional(seq(tensor(complex128))), | ||
17 | optional(seq(tensor(complex64))), | ||
18 | optional(seq(tensor(double))), | ||
19 | optional(seq(tensor(float))), | ||
20 | optional(seq(tensor(float16))), | ||
21 | optional(seq(tensor(int16))), | ||
22 | optional(seq(tensor(int32))), | ||
23 | optional(seq(tensor(int64))), | ||
24 | optional(seq(tensor(int8))), | ||
25 | optional(seq(tensor(string))), | ||
26 | optional(seq(tensor(uint16))), | ||
27 | optional(seq(tensor(uint32))), | ||
28 | optional(seq(tensor(uint64))), | ||
29 | optional(seq(tensor(uint8))), | ||
30 | optional(tensor(bool)), | ||
31 | optional(tensor(complex128)), | ||
32 | optional(tensor(complex64)), | ||
33 | optional(tensor(double)), | ||
34 | optional(tensor(float)), | ||
35 | optional(tensor(float16)), | ||
36 | optional(tensor(int16)), | ||
37 | optional(tensor(int32)), | ||
38 | optional(tensor(int64)), | ||
39 | optional(tensor(int8)), | ||
40 | optional(tensor(string)), | ||
41 | optional(tensor(uint16)), | ||
42 | optional(tensor(uint32)), | ||
43 | optional(tensor(uint64)), | ||
44 | optional(tensor(uint8)), | ||
15 | 45 | seq(tensor(bool)), | seq(tensor(bool)), |
16 | 46 | seq(tensor(complex128)), | seq(tensor(complex128)), |
17 | 47 | seq(tensor(complex64)), | seq(tensor(complex64)), |
18 | 48 | seq(tensor(double)), | seq(tensor(double)), |
19 | 49 | seq(tensor(float)), | seq(tensor(float)), |
20 | 50 | seq(tensor(float16)), | seq(tensor(float16)), |
21 | 51 | seq(tensor(int16)), | seq(tensor(int16)), |
22 | 52 | seq(tensor(int32)), | seq(tensor(int32)), |
23 | 53 | seq(tensor(int64)), | seq(tensor(int64)), |
24 | 54 | seq(tensor(int8)), | seq(tensor(int8)), |
25 | 55 | seq(tensor(string)), | seq(tensor(string)), |
26 | 56 | seq(tensor(uint16)), | seq(tensor(uint16)), |
27 | 57 | seq(tensor(uint32)), | seq(tensor(uint32)), |
28 | 58 | seq(tensor(uint64)), | seq(tensor(uint64)), |
29 | 59 | seq(tensor(uint8)), | seq(tensor(uint8)), |
30 | 60 | tensor(bfloat16), | tensor(bfloat16), |
31 | 61 | tensor(bool), | tensor(bool), |
32 | 62 | tensor(complex128), | tensor(complex128), |
33 | 63 | tensor(complex64), | tensor(complex64), |
34 | 64 | tensor(double), | tensor(double), |
35 | 65 | tensor(float), | tensor(float), |
36 | 66 | tensor(float16), | tensor(float16), |
37 | 67 | tensor(int16), | tensor(int16), |
38 | 68 | tensor(int32), | tensor(int32), |
39 | 69 | tensor(int64), | tensor(int64), |
40 | 70 | tensor(int8), | tensor(int8), |
41 | 71 | tensor(string), | tensor(string), |
42 | 72 | tensor(uint16), | tensor(uint16), |
43 | 73 | tensor(uint32), | tensor(uint32), |
44 | 74 | tensor(uint64), | tensor(uint64), |
45 | 75 | tensor(uint8) | tensor(uint8) |
46 | 76 | ): | ): |
47 | 77 | Constrain input and output types to all tensor and sequence types. |
|
78 | optional types. |
Identity - 14#
Version
name: Identity (GitHub)
domain: main
since_version: 14
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 14.
Summary
Identity operator
Inputs
input (heterogeneous) - V: Input tensor
Outputs
output (heterogeneous) - V: Tensor to copy input into.
Type Constraints
V in ( seq(tensor(bool)), seq(tensor(complex128)), seq(tensor(complex64)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(string)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)), tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor and sequence types.
Differences
0 | 0 | Identity operator | Identity operator |
1 | 1 |
|
|
2 | 2 | **Inputs** | **Inputs** |
3 | 3 |
|
|
4 | 4 | * **input** (heterogeneous) - **T**: |
|
5 | 5 | Input tensor | Input tensor |
6 | 6 |
|
|
7 | 7 | **Outputs** | **Outputs** |
8 | 8 |
|
|
9 | 9 | * **output** (heterogeneous) - **T**: |
|
10 | 10 | Tensor to copy input into. | Tensor to copy input into. |
11 | 11 |
|
|
12 | 12 | **Type Constraints** | **Type Constraints** |
13 | 13 |
|
|
14 | 14 | * **T** in ( |
|
15 | seq(tensor(bool)), | ||
16 | seq(tensor(complex128)), | ||
17 | seq(tensor(complex64)), | ||
18 | seq(tensor(double)), | ||
19 | seq(tensor(float)), | ||
20 | seq(tensor(float16)), | ||
21 | seq(tensor(int16)), | ||
22 | seq(tensor(int32)), | ||
23 | seq(tensor(int64)), | ||
24 | seq(tensor(int8)), | ||
25 | seq(tensor(string)), | ||
26 | seq(tensor(uint16)), | ||
27 | seq(tensor(uint32)), | ||
28 | seq(tensor(uint64)), | ||
29 | seq(tensor(uint8)), | ||
15 | 30 | tensor(bfloat16), | tensor(bfloat16), |
16 | 31 | tensor(bool), | tensor(bool), |
17 | 32 | tensor(complex128), | tensor(complex128), |
18 | 33 | tensor(complex64), | tensor(complex64), |
19 | 34 | tensor(double), | tensor(double), |
20 | 35 | tensor(float), | tensor(float), |
21 | 36 | tensor(float16), | tensor(float16), |
22 | 37 | tensor(int16), | tensor(int16), |
23 | 38 | tensor(int32), | tensor(int32), |
24 | 39 | tensor(int64), | tensor(int64), |
25 | 40 | tensor(int8), | tensor(int8), |
26 | 41 | tensor(string), | tensor(string), |
27 | 42 | tensor(uint16), | tensor(uint16), |
28 | 43 | tensor(uint32), | tensor(uint32), |
29 | 44 | tensor(uint64), | tensor(uint64), |
30 | 45 | tensor(uint8) | tensor(uint8) |
31 | 46 | ): | ): |
32 | 47 | Constrain input and output types to all tensor types. |
|
Identity - 13#
Version
name: Identity (GitHub)
domain: main
since_version: 13
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 13.
Summary
Identity operator
Inputs
input (heterogeneous) - T: Input tensor
Outputs
output (heterogeneous) - T: Tensor to copy input into.
Type Constraints
T in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor types.
Differences
0 | 0 | Identity operator | Identity operator |
1 | 1 |
|
|
2 | 2 | **Inputs** | **Inputs** |
3 | 3 |
|
|
4 | 4 | * **input** (heterogeneous) - **T**: | * **input** (heterogeneous) - **T**: |
5 | 5 | Input tensor | Input tensor |
6 | 6 |
|
|
7 | 7 | **Outputs** | **Outputs** |
8 | 8 |
|
|
9 | 9 | * **output** (heterogeneous) - **T**: | * **output** (heterogeneous) - **T**: |
10 | 10 | Tensor to copy input into. | Tensor to copy input into. |
11 | 11 |
|
|
12 | 12 | **Type Constraints** | **Type Constraints** |
13 | 13 |
|
|
14 | 14 | * **T** in ( | * **T** in ( |
15 | tensor(bfloat16), | ||
15 | 16 | tensor(bool), | tensor(bool), |
16 | 17 | tensor(complex128), | tensor(complex128), |
17 | 18 | tensor(complex64), | tensor(complex64), |
18 | 19 | tensor(double), | tensor(double), |
19 | 20 | tensor(float), | tensor(float), |
20 | 21 | tensor(float16), | tensor(float16), |
21 | 22 | tensor(int16), | tensor(int16), |
22 | 23 | tensor(int32), | tensor(int32), |
23 | 24 | tensor(int64), | tensor(int64), |
24 | 25 | tensor(int8), | tensor(int8), |
25 | 26 | tensor(string), | tensor(string), |
26 | 27 | tensor(uint16), | tensor(uint16), |
27 | 28 | tensor(uint32), | tensor(uint32), |
28 | 29 | tensor(uint64), | tensor(uint64), |
29 | 30 | tensor(uint8) | tensor(uint8) |
30 | 31 | ): | ): |
31 | 32 | Constrain input and output types to all tensor types. | Constrain input and output types to all tensor types. |
Identity - 1#
Version
name: Identity (GitHub)
domain: main
since_version: 1
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 1.
Summary
Identity operator
Inputs
input (heterogeneous) - T: Input tensor
Outputs
output (heterogeneous) - T: Tensor to copy input into.
Type Constraints
T in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor types.