modeci_mdf.functions.onnx.gather
- modeci_mdf.functions.onnx.gather(*args, **kwargs)
Given data tensor of rank r >= 1, and indices tensor of rank q, gather entries of the axis dimension of data (by default outer-most one as axis=0) indexed by indices, and concatenates them in an output tensor of rank q + (r - 1).
axis = 0 :
Let k = indices[i_{0}, …, i_{q-1}] Then output[i_{0}, …, i_{q-1}, j_{0}, …, j_{r-2}] = input[k , j_{0}, …, j_{r-2}]
- ```
- data = [
[1.0, 1.2], [2.3, 3.4], [4.5, 5.7],
] indices = [
[0, 1], [1, 2],
] output = [
- [
[1.0, 1.2], [2.3, 3.4],
], [
[2.3, 3.4], [4.5, 5.7],
],
]
``` axis = 1 :
Let k = indices[i_{0}, …, i_{q-1}] Then output[j_{0}, i_{0}, …, i_{q-1}, j_{1}, …, j_{r-2}] = input[j_{0}, k, j_{1}, …, j_{r-2}]