API in libtorch that achieves the same function as in python

Hi, guys,
I have two questions for libtorch API
<1> In python, we can write as
boxes_filtered = boxes[keep]
the shape of boxes is [ 80, 200, 4]
the shape of keep is [80, 200], and there are 40 “True” elements in keep
so, we get the shape of boxes_filtered is [40, 4]
I want to ask, is there an api that implements the same funcition in libtorch?
<2> In python, we can write as
image = image[:, :, ::-1]
So, is there an api that implements the same funcition in libtorch?
Thank you so much : )

  1. Yes, it should work as explained in the Tensor Indexing API.

  2. Should also be possible, see 1.

Thank you so much for reply~