ScatterElements#

ScatterElements - 16#

Version

  • name: ScatterElements (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

ScatterElements takes three inputs data, updates, and indices of the same rank r >= 1 and an optional attribute axis that identifies an axis of data (by default, the outer-most axis, that is axis 0). The output of the operation is produced by creating a copy of the input data, and then updating its value to values specified by updates at specific index positions specified by indices. Its output shape is the same as the shape of data.

For each entry in updates, the target index in data is obtained by combining the corresponding entry in indices with the index of the entry itself: the index-value for dimension = axis is obtained from the value of the corresponding entry in indices and the index-value for dimension != axis is obtained from the index of the entry itself.

reduction allows specification of an optional reduction operation, which is applied to all values in updates tensor into output at the specified indices. In cases where reduction is set to “none”, indices should not have duplicate entries: that is, if idx1 != idx2, then indices[idx1] != indices[idx2]. For instance, in a 2-D tensor case, the update corresponding to the [i][j] entry is performed as below:

output[indices[i][j]][j] = updates[i][j] if axis = 0,
output[i][indices[i][j]] = updates[i][j] if axis = 1,

When reduction is set to “add”, the update corresponding to the [i][j] entry is performed as below:

output[indices[i][j]][j] += updates[i][j] if axis = 0,
output[i][indices[i][j]] += updates[i][j] if axis = 1,

When reduction is set to “mul”, the update corresponding to the [i][j] entry is performed as below:

output[indices[i][j]][j] *= updates[i][j] if axis = 0,
output[i][indices[i][j]] *= updates[i][j] if axis = 1,

This operator is the inverse of GatherElements. It is similar to Torch’s Scatter operation.

Example 1:

data = [
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
]
indices = [
    [1, 0, 2],
    [0, 2, 1],
]
updates = [
    [1.0, 1.1, 1.2],
    [2.0, 2.1, 2.2],
]
output = [
    [2.0, 1.1, 0.0]
    [1.0, 0.0, 2.2]
    [0.0, 2.1, 1.2]
]

Example 2:

data = [[1.0, 2.0, 3.0, 4.0, 5.0]]
indices = [[1, 3]]
updates = [[1.1, 2.1]]
axis = 1
output = [[1.0, 1.1, 3.0, 2.1, 5.0]]

Attributes

  • axis: Which axis to scatter on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • reduction: Type of reduction to apply: none (default), add, mul. ‘none’: no reduction applied. ‘add’: reduction using the addition operation. ‘mul’: reduction using the multiplication operation. Default value is 'none'.

Inputs

  • data (heterogeneous) - T: Tensor of rank r >= 1.

  • indices (heterogeneous) - Tind: Tensor of int32/int64 indices, of r >= 1 (same rank as input). All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.

  • updates (heterogeneous) - T: Tensor of rank r >=1 (same rank and shape as indices)

Outputs

  • output (heterogeneous) - T: Tensor of rank r >= 1 (same rank as input).

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) ): Input and output types can be of any tensor type.

  • Tind in ( tensor(int32), tensor(int64) ): Constrain indices to integer types

Examples

scatter_elements_without_axis

node = onnx.helper.make_node(
    'ScatterElements',
    inputs=['data', 'indices', 'updates'],
    outputs=['y'],
)
data = np.zeros((3, 3), dtype=np.float32)
indices = np.array([[1, 0, 2], [0, 2, 1]], dtype=np.int64)
updates = np.array([[1.0, 1.1, 1.2], [2.0, 2.1, 2.2]], dtype=np.float32)

y = scatter_elements(data, indices, updates)
# print(y) produces
# [[2.0, 1.1, 0.0],
#  [1.0, 0.0, 2.2],
#  [0.0, 2.1, 1.2]]

expect(node, inputs=[data, indices, updates], outputs=[y],
       name='test_scatter_elements_without_axis')

scatter_elements_with_axis

axis = 1
node = onnx.helper.make_node(
    'ScatterElements',
    inputs=['data', 'indices', 'updates'],
    outputs=['y'],
    axis=axis,
)
data = np.array([[1.0, 2.0, 3.0, 4.0, 5.0]], dtype=np.float32)
indices = np.array([[1, 3]], dtype=np.int64)
updates = np.array([[1.1, 2.1]], dtype=np.float32)

y = scatter_elements(data, indices, updates, axis)
# print(y) produces
# [[1.0, 1.1, 3.0, 2.1, 5.0]]

expect(node, inputs=[data, indices, updates], outputs=[y],
       name='test_scatter_elements_with_axis')

scatter_elements_with_negative_indices

axis = 1
node = onnx.helper.make_node(
    'ScatterElements',
    inputs=['data', 'indices', 'updates'],
    outputs=['y'],
    axis=axis,
)
data = np.array([[1.0, 2.0, 3.0, 4.0, 5.0]], dtype=np.float32)
indices = np.array([[1, -3]], dtype=np.int64)
updates = np.array([[1.1, 2.1]], dtype=np.float32)

y = scatter_elements(data, indices, updates, axis)
# print(y) produces
# [[1.0, 1.1, 2.1, 4.0, 5.0]]

expect(node, inputs=[data, indices, updates], outputs=[y],
       name='test_scatter_elements_with_negative_indices')

scatter_elements_with_duplicate_indices

axis = 1
node = onnx.helper.make_node(
    'ScatterElements',
    inputs=['data', 'indices', 'updates'],
    outputs=['y'],
    axis=axis,
    reduction='add',
)
data = np.array([[1.0, 2.0, 3.0, 4.0, 5.0]], dtype=np.float32)
indices = np.array([[1, 1]], dtype=np.int64)
updates = np.array([[1.1, 2.1]], dtype=np.float32)

y = scatter_elements(data, indices, updates, axis, reduction='add')
# print(y) produces
# [[1.0, 5.2, 3.0, 4.0, 5.0]]

expect(node, inputs=[data, indices, updates], outputs=[y],
        name='test_scatter_elements_with_duplicate_indices')

Differences

00ScatterElements takes three inputs data, updates, and indices of the sameScatterElements takes three inputs data, updates, and indices of the same
11rank r >= 1 and an optional attribute axis that identifies an axis of datarank r >= 1 and an optional attribute axis that identifies an axis of data
22(by default, the outer-most axis, that is axis 0). The output of the operation(by default, the outer-most axis, that is axis 0). The output of the operation
33is produced by creating a copy of the input data, and then updating its valueis produced by creating a copy of the input data, and then updating its value
44to values specified by updates at specific index positions specified byto values specified by updates at specific index positions specified by
55indices. Its output shape is the same as the shape of data.indices. Its output shape is the same as the shape of data.
66
77For each entry in updates, the target index in data is obtained by combiningFor each entry in updates, the target index in data is obtained by combining
88the corresponding entry in indices with the index of the entry itself: thethe corresponding entry in indices with the index of the entry itself: the
99index-value for dimension = axis is obtained from the value of the correspondingindex-value for dimension = axis is obtained from the value of the corresponding
1010entry in indices and the index-value for dimension != axis is obtained from theentry in indices and the index-value for dimension != axis is obtained from the
1111index of the entry itself.index of the entry itself.
1212
13reduction allows specification of an optional reduction operation, which is applied to all values in updates
14tensor into output at the specified indices.
15In cases where reduction is set to "none", indices should not have duplicate entries: that is, if idx1 != idx2,
16then indices[idx1] != indices[idx2]. For instance, in a 2-D tensor case, the update
17corresponding to the [i][j] entry is performed as below:
18::
19
20 output[indices[i][j]][j] = updates[i][j] if axis = 0,
21 output[i][indices[i][j]] = updates[i][j] if axis = 1,
22
1323For instance, in a 2-D tensor case, the update corresponding to the [i][j] entryWhen reduction is set to "add", the update corresponding to the [i][j] entry is performed as below:
24::
25
26 output[indices[i][j]][j] += updates[i][j] if axis = 0,
27 output[i][indices[i][j]] += updates[i][j] if axis = 1,
28
1429is performed as below:When reduction is set to "mul", the update corresponding to the [i][j] entry is performed as below:
1530::::
1631
1732 output[indices[i][j]][j] = updates[i][j] if axis = 0, output[indices[i][j]][j] *= updates[i][j] if axis = 0,
1833 output[i][indices[i][j]] = updates[i][j] if axis = 1, output[i][indices[i][j]] *= updates[i][j] if axis = 1,
1934
2035This operator is the inverse of GatherElements. It is similar to Torch's Scatter operation.This operator is the inverse of GatherElements. It is similar to Torch's Scatter operation.
2136
2237Example 1:Example 1:
2338::::
2439
2540 data = [ data = [
2641 [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
2742 [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
2843 [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
2944 ] ]
3045 indices = [ indices = [
3146 [1, 0, 2], [1, 0, 2],
3247 [0, 2, 1], [0, 2, 1],
3348 ] ]
3449 updates = [ updates = [
3550 [1.0, 1.1, 1.2], [1.0, 1.1, 1.2],
3651 [2.0, 2.1, 2.2], [2.0, 2.1, 2.2],
3752 ] ]
3853 output = [ output = [
3954 [2.0, 1.1, 0.0] [2.0, 1.1, 0.0]
4055 [1.0, 0.0, 2.2] [1.0, 0.0, 2.2]
4156 [0.0, 2.1, 1.2] [0.0, 2.1, 1.2]
4257 ] ]
4358
4459Example 2:Example 2:
4560::::
4661
4762 data = [[1.0, 2.0, 3.0, 4.0, 5.0]] data = [[1.0, 2.0, 3.0, 4.0, 5.0]]
4863 indices = [[1, 3]] indices = [[1, 3]]
4964 updates = [[1.1, 2.1]] updates = [[1.1, 2.1]]
5065 axis = 1 axis = 1
5166 output = [[1.0, 1.1, 3.0, 2.1, 5.0]] output = [[1.0, 1.1, 3.0, 2.1, 5.0]]
5267
5368**Attributes****Attributes**
5469
5570* **axis**:* **axis**:
5671 Which axis to scatter on. Negative value means counting dimensions Which axis to scatter on. Negative value means counting dimensions
5772 from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is 0. from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.
73* **reduction**:
74 Type of reduction to apply: none (default), add, mul. 'none': no
75 reduction applied. 'add': reduction using the addition operation.
76 'mul': reduction using the multiplication operation. Default value is 'none'.
5877
5978**Inputs****Inputs**
6079
6180* **data** (heterogeneous) - **T**:* **data** (heterogeneous) - **T**:
6281 Tensor of rank r >= 1. Tensor of rank r >= 1.
6382* **indices** (heterogeneous) - **Tind**:* **indices** (heterogeneous) - **Tind**:
6483 Tensor of int32/int64 indices, of r >= 1 (same rank as input). All Tensor of int32/int64 indices, of r >= 1 (same rank as input). All
6584 index values are expected to be within bounds [-s, s-1] along axis index values are expected to be within bounds [-s, s-1] along axis
6685 of size s. It is an error if any of the index values are out of of size s. It is an error if any of the index values are out of
6786 bounds. bounds.
6887* **updates** (heterogeneous) - **T**:* **updates** (heterogeneous) - **T**:
6988 Tensor of rank r >=1 (same rank and shape as indices) Tensor of rank r >=1 (same rank and shape as indices)
7089
7190**Outputs****Outputs**
7291
7392* **output** (heterogeneous) - **T**:* **output** (heterogeneous) - **T**:
7493 Tensor of rank r >= 1 (same rank as input). Tensor of rank r >= 1 (same rank as input).
7594
7695**Type Constraints****Type Constraints**
7796
7897* **T** in (* **T** in (
7998 tensor(bfloat16), tensor(bfloat16),
8099 tensor(bool), tensor(bool),
81100 tensor(complex128), tensor(complex128),
82101 tensor(complex64), tensor(complex64),
83102 tensor(double), tensor(double),
84103 tensor(float), tensor(float),
85104 tensor(float16), tensor(float16),
86105 tensor(int16), tensor(int16),
87106 tensor(int32), tensor(int32),
88107 tensor(int64), tensor(int64),
89108 tensor(int8), tensor(int8),
90109 tensor(string), tensor(string),
91110 tensor(uint16), tensor(uint16),
92111 tensor(uint32), tensor(uint32),
93112 tensor(uint64), tensor(uint64),
94113 tensor(uint8) tensor(uint8)
95114 ): ):
96115 Input and output types can be of any tensor type. Input and output types can be of any tensor type.
97116* **Tind** in (* **Tind** in (
98117 tensor(int32), tensor(int32),
99118 tensor(int64) tensor(int64)
100119 ): ):
101120 Constrain indices to integer types Constrain indices to integer types

ScatterElements - 13#

Version

  • name: ScatterElements (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

ScatterElements takes three inputs data, updates, and indices of the same rank r >= 1 and an optional attribute axis that identifies an axis of data (by default, the outer-most axis, that is axis 0). The output of the operation is produced by creating a copy of the input data, and then updating its value to values specified by updates at specific index positions specified by indices. Its output shape is the same as the shape of data.

For each entry in updates, the target index in data is obtained by combining the corresponding entry in indices with the index of the entry itself: the index-value for dimension = axis is obtained from the value of the corresponding entry in indices and the index-value for dimension != axis is obtained from the index of the entry itself.

For instance, in a 2-D tensor case, the update corresponding to the [i][j] entry is performed as below:

output[indices[i][j]][j] = updates[i][j] if axis = 0,
output[i][indices[i][j]] = updates[i][j] if axis = 1,

This operator is the inverse of GatherElements. It is similar to Torch’s Scatter operation.

Example 1:

data = [
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
]
indices = [
    [1, 0, 2],
    [0, 2, 1],
]
updates = [
    [1.0, 1.1, 1.2],
    [2.0, 2.1, 2.2],
]
output = [
    [2.0, 1.1, 0.0]
    [1.0, 0.0, 2.2]
    [0.0, 2.1, 1.2]
]

Example 2:

data = [[1.0, 2.0, 3.0, 4.0, 5.0]]
indices = [[1, 3]]
updates = [[1.1, 2.1]]
axis = 1
output = [[1.0, 1.1, 3.0, 2.1, 5.0]]

Attributes

  • axis: Which axis to scatter on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

Inputs

  • data (heterogeneous) - T: Tensor of rank r >= 1.

  • indices (heterogeneous) - Tind: Tensor of int32/int64 indices, of r >= 1 (same rank as input). All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.

  • updates (heterogeneous) - T: Tensor of rank r >=1 (same rank and shape as indices)

Outputs

  • output (heterogeneous) - T: Tensor of rank r >= 1 (same rank as input).

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) ): Input and output types can be of any tensor type.

  • Tind in ( tensor(int32), tensor(int64) ): Constrain indices to integer types

Differences

00ScatterElements takes three inputs data, updates, and indices of the sameScatterElements takes three inputs data, updates, and indices of the same
11rank r >= 1 and an optional attribute axis that identifies an axis of datarank r >= 1 and an optional attribute axis that identifies an axis of data
22(by default, the outer-most axis, that is axis 0). The output of the operation(by default, the outer-most axis, that is axis 0). The output of the operation
33is produced by creating a copy of the input data, and then updating its valueis produced by creating a copy of the input data, and then updating its value
44to values specified by updates at specific index positions specified byto values specified by updates at specific index positions specified by
55indices. Its output shape is the same as the shape of data.indices. Its output shape is the same as the shape of data.
66
77For each entry in updates, the target index in data is obtained by combiningFor each entry in updates, the target index in data is obtained by combining
88the corresponding entry in indices with the index of the entry itself: thethe corresponding entry in indices with the index of the entry itself: the
99index-value for dimension = axis is obtained from the value of the correspondingindex-value for dimension = axis is obtained from the value of the corresponding
1010entry in indices and the index-value for dimension != axis is obtained from theentry in indices and the index-value for dimension != axis is obtained from the
1111index of the entry itself.index of the entry itself.
1212
1313For instance, in a 2-D tensor case, the update corresponding to the [i][j] entryFor instance, in a 2-D tensor case, the update corresponding to the [i][j] entry
1414is performed as below:is performed as below:
1515::::
1616
1717 output[indices[i][j]][j] = updates[i][j] if axis = 0, output[indices[i][j]][j] = updates[i][j] if axis = 0,
1818 output[i][indices[i][j]] = updates[i][j] if axis = 1, output[i][indices[i][j]] = updates[i][j] if axis = 1,
1919
2020This operator is the inverse of GatherElements. It is similar to Torch's Scatter operation.This operator is the inverse of GatherElements. It is similar to Torch's Scatter operation.
2121
2222Example 1:Example 1:
2323::::
2424
2525 data = [ data = [
2626 [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
2727 [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
2828 [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
2929 ] ]
3030 indices = [ indices = [
3131 [1, 0, 2], [1, 0, 2],
3232 [0, 2, 1], [0, 2, 1],
3333 ] ]
3434 updates = [ updates = [
3535 [1.0, 1.1, 1.2], [1.0, 1.1, 1.2],
3636 [2.0, 2.1, 2.2], [2.0, 2.1, 2.2],
3737 ] ]
3838 output = [ output = [
3939 [2.0, 1.1, 0.0] [2.0, 1.1, 0.0]
4040 [1.0, 0.0, 2.2] [1.0, 0.0, 2.2]
4141 [0.0, 2.1, 1.2] [0.0, 2.1, 1.2]
4242 ] ]
4343
4444Example 2:Example 2:
4545::::
4646
4747 data = [[1.0, 2.0, 3.0, 4.0, 5.0]] data = [[1.0, 2.0, 3.0, 4.0, 5.0]]
4848 indices = [[1, 3]] indices = [[1, 3]]
4949 updates = [[1.1, 2.1]] updates = [[1.1, 2.1]]
5050 axis = 1 axis = 1
5151 output = [[1.0, 1.1, 3.0, 2.1, 5.0]] output = [[1.0, 1.1, 3.0, 2.1, 5.0]]
5252
5353**Attributes****Attributes**
5454
5555* **axis**:* **axis**:
5656 Which axis to scatter on. Negative value means counting dimensions Which axis to scatter on. Negative value means counting dimensions
5757 from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is 0. from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.
5858
5959**Inputs****Inputs**
6060
6161* **data** (heterogeneous) - **T**:* **data** (heterogeneous) - **T**:
6262 Tensor of rank r >= 1. Tensor of rank r >= 1.
6363* **indices** (heterogeneous) - **Tind**:* **indices** (heterogeneous) - **Tind**:
6464 Tensor of int32/int64 indices, of r >= 1 (same rank as input). All Tensor of int32/int64 indices, of r >= 1 (same rank as input). All
6565 index values are expected to be within bounds [-s, s-1] along axis index values are expected to be within bounds [-s, s-1] along axis
6666 of size s. It is an error if any of the index values are out of of size s. It is an error if any of the index values are out of
6767 bounds. bounds.
6868* **updates** (heterogeneous) - **T**:* **updates** (heterogeneous) - **T**:
6969 Tensor of rank r >=1 (same rank and shape as indices) Tensor of rank r >=1 (same rank and shape as indices)
7070
7171**Outputs****Outputs**
7272
7373* **output** (heterogeneous) - **T**:* **output** (heterogeneous) - **T**:
7474 Tensor of rank r >= 1 (same rank as input). Tensor of rank r >= 1 (same rank as input).
7575
7676**Type Constraints****Type Constraints**
7777
7878* **T** in (* **T** in (
79 tensor(bfloat16),
7980 tensor(bool), tensor(bool),
8081 tensor(complex128), tensor(complex128),
8182 tensor(complex64), tensor(complex64),
8283 tensor(double), tensor(double),
8384 tensor(float), tensor(float),
8485 tensor(float16), tensor(float16),
8586 tensor(int16), tensor(int16),
8687 tensor(int32), tensor(int32),
8788 tensor(int64), tensor(int64),
8889 tensor(int8), tensor(int8),
8990 tensor(string), tensor(string),
9091 tensor(uint16), tensor(uint16),
9192 tensor(uint32), tensor(uint32),
9293 tensor(uint64), tensor(uint64),
9394 tensor(uint8) tensor(uint8)
9495 ): ):
9596 Input and output types can be of any tensor type. Input and output types can be of any tensor type.
9697* **Tind** in (* **Tind** in (
9798 tensor(int32), tensor(int32),
9899 tensor(int64) tensor(int64)
99100 ): ):
100101 Constrain indices to integer types Constrain indices to integer types

ScatterElements - 11#

Version

  • name: ScatterElements (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

ScatterElements takes three inputs data, updates, and indices of the same rank r >= 1 and an optional attribute axis that identifies an axis of data (by default, the outer-most axis, that is axis 0). The output of the operation is produced by creating a copy of the input data, and then updating its value to values specified by updates at specific index positions specified by indices. Its output shape is the same as the shape of data.

For each entry in updates, the target index in data is obtained by combining the corresponding entry in indices with the index of the entry itself: the index-value for dimension = axis is obtained from the value of the corresponding entry in indices and the index-value for dimension != axis is obtained from the index of the entry itself.

For instance, in a 2-D tensor case, the update corresponding to the [i][j] entry is performed as below:

output[indices[i][j]][j] = updates[i][j] if axis = 0,
output[i][indices[i][j]] = updates[i][j] if axis = 1,

This operator is the inverse of GatherElements. It is similar to Torch’s Scatter operation.

Example 1:

data = [
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
]
indices = [
    [1, 0, 2],
    [0, 2, 1],
]
updates = [
    [1.0, 1.1, 1.2],
    [2.0, 2.1, 2.2],
]
output = [
    [2.0, 1.1, 0.0]
    [1.0, 0.0, 2.2]
    [0.0, 2.1, 1.2]
]

Example 2:

data = [[1.0, 2.0, 3.0, 4.0, 5.0]]
indices = [[1, 3]]
updates = [[1.1, 2.1]]
axis = 1
output = [[1.0, 1.1, 3.0, 2.1, 5.0]]

Attributes

  • axis: Which axis to scatter on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

Inputs

  • data (heterogeneous) - T: Tensor of rank r >= 1.

  • indices (heterogeneous) - Tind: Tensor of int32/int64 indices, of r >= 1 (same rank as input). All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.

  • updates (heterogeneous) - T: Tensor of rank r >=1 (same rank and shape as indices)

Outputs

  • output (heterogeneous) - T: Tensor of rank r >= 1 (same rank as input).

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) ): Input and output types can be of any tensor type.

  • Tind in ( tensor(int32), tensor(int64) ): Constrain indices to integer types