Closed lambdawill closed 7 years ago
What is the bug here?
@pavanky I hope the answer to the first example should be
2
3
4
6
7
10
For the second example, all equals '5' ? It is quite strange! Maybe it should output
5
3
4
1
I cannot understand what the variable 'i' really means according to the output.
@TYLVY It looks like it is returning the last instance of the mode inside the tensor. It so happens both of your examples have mode as the last element. May be try a few other examples?
The choice of the index is completely arbitrary but correct. The guarantee it is providing is "some index whose value in the original tensor is equal to the mode", not the first index etc.
When using 2D tensor