Hi KFrank, thanks for your answer. Is there a way that I can use gather() without repeat P along certain axis? Say that my X is a tensor with more axis (a, b, c, d, …), then is there a way to naturally broadcast P?