Slicing tensors with data_ptr and accessor

The libtorch system provides two apis to access a Tensor via reference pointers, viz., data_ptr and 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 .index() and .slice() functions directly on the tensor is that they create copies, thus consuming extra memory.

Any help is welcome.