The libtorch system provides two apis to access a Tensor via reference pointers, viz.,
accessor. The problem is, to access single element in the tensor, I am able to understand the syntax, but, if I want to perform slicing, the PyTorch cpp forntend documentation does not mention anything.
What is the syntax to perform slicing on the Tensor via the above the pointers?
The problem with using the
.slice() functions directly on the tensor is that they create copies, thus consuming extra memory.
Any help is welcome.