How to flip a tensor along a specified axis

When using biRNN I need to flip a input tensor along depth axis, but the function torch.index_select seems to block the flow of training gradients. So is there any reasonable way to do this operation correctly ?
Any advice would be appreciated !!!

IndexSelect should not block gradients (see :slight_smile: