Hi, @AndrewZhaoLuo
If the data is multi-dimension, let say 3d tensor. If I want to get the last-dimension max value, the np.take
can not get the right value from argmax result, as same as the relay.take
in TVM
import numpy as np
tensor = np.arange(2 * 3 * 4).reshape(2, 3, 4)
print("tensor = ", tensor)
idx = np.argmax(tensor,axis=-1, keepdims=True)
print("idx = ", idx)
max_val_from_take = np.take(tensor, idx, axis=-1)
print("max_val_from_take = ", max_val_from_take)
max_val_from_take_along_axis = np.take_along_axis(tensor, idx, axis=-1)
print("max_val_from_take_along_axis = ", max_val_from_take_along_axis)