In Pytorch
import torch

temp_data = torch.tensor([1, 2, 3, 4])  

# temp_data = tensor([1, 2, 3, 4])

temp_data[0] = 5

# temp_data = tensor([5, 2, 3, 4])

So how can something similar be done in c++？？
Thanks a lot.