Gather - 11 vs 13

Files changed (1) hide show
  1. Gather11 → Gather13 +5 -6
Gather11 → Gather13 RENAMED
@@ -1 +1 @@
1
1
  Given data tensor of rank r >= 1, and indices tensor of rank q, gather
2
2
  entries of the axis dimension of data (by default outer-most one as axis=0) indexed by indices, and concatenates
3
3
  them in an output tensor of rank q + (r - 1).
4
4
  axis = 0 :
5
5
  Let
6
6
  k = indices[i_{0}, ..., i_{q-1}]
7
7
  Then
8
8
  output[i_{0}, ..., i_{q-1}, j_{0}, ..., j_{r-2}] = input[k , j_{0}, ..., j_{r-2}]
9
9
  ::
10
10
  data = [
11
11
  [1.0, 1.2],
12
12
  [2.3, 3.4],
13
13
  [4.5, 5.7],
14
14
  ]
15
15
  indices = [
16
16
  [0, 1],
17
17
  [1, 2],
18
18
  ]
19
19
  output = [
20
20
  [
21
21
  [1.0, 1.2],
22
22
  [2.3, 3.4],
23
23
  ],
24
24
  [
25
25
  [2.3, 3.4],
26
26
  [4.5, 5.7],
27
27
  ],
28
28
  ]
29
29
  axis = 1 :
30
30
  Let
31
31
  k = indices[i_{0}, ..., i_{q-1}]
32
32
  Then
33
- output[i_{0}, ..., i_{q-1}, j_{0}, ..., j_{r-2}] = input[j_{0}, k, j_{1}, ..., j_{r-2}]
33
+ output[j_{0}, i_{0}, ..., i_{q-1}, j_{1}, ..., j_{r-2}] = input[j_{0}, k, j_{1}, ..., j_{r-2}]
34
34
  ::
35
35
  data = [
36
36
  [1.0, 1.2, 1.9],
37
37
  [2.3, 3.4, 3.9],
38
38
  [4.5, 5.7, 5.9],
39
39
  ]
40
40
  indices = [
41
41
  [0, 2],
42
42
  ]
43
43
  axis = 1,
44
44
  output = [
45
- [
46
- [1.0, 1.9],
45
+ [[1.0, 1.9]],
47
- [2.3, 3.9],
46
+ [[2.3, 3.9]],
48
- [4.5, 5.9],
47
+ [[4.5, 5.9]],
49
- ],
50
48
  ]
51
49
  **Attributes**
52
50
  * **axis**:
53
51
  Which axis to gather on. Negative value means counting dimensions
54
52
  from the back. Accepted range is [-r, r-1] where r = rank(data).
55
53
  **Inputs**
56
54
  * **data** (heterogeneous) - **T**:
57
55
  Tensor of rank r >= 1.
58
56
  * **indices** (heterogeneous) - **Tind**:
59
57
  Tensor of int32/int64 indices, of any rank q. All index values are
60
58
  expected to be within bounds [-s, s-1] along axis of size s. It is
61
59
  an error if any of the index values are out of bounds.
62
60
  **Outputs**
63
61
  * **output** (heterogeneous) - **T**:
64
62
  Tensor of rank q + (r - 1).
65
63
  **Type Constraints**
66
64
  * **T** in (
65
+ tensor(bfloat16),
67
66
  tensor(bool),
68
67
  tensor(complex128),
69
68
  tensor(complex64),
70
69
  tensor(double),
71
70
  tensor(float),
72
71
  tensor(float16),
73
72
  tensor(int16),
74
73
  tensor(int32),
75
74
  tensor(int64),
76
75
  tensor(int8),
77
76
  tensor(string),
78
77
  tensor(uint16),
79
78
  tensor(uint32),
80
79
  tensor(uint64),
81
80
  tensor(uint8)
82
81
  ):
83
82
  Constrain input and output types to any tensor type.
84
83
  * **Tind** in (
85
84
  tensor(int32),
86
85
  tensor(int64)
87
86
  ):
88
87
  Constrain indices to integer types