Let's say I have a numpy array arr = np.array([1, 2, 3]) and a pytorch tensor tnsr = torch.zeros(3,)
Is there a way to read the data contained in arr to the tensor tnsr, which already exists rather than simply creating a new tensor like tnsr1 = torch.tensor(arr).
This is a simplified example of the problem, since I am using a dataset that contains nearly 17 million entries.
EDIT: I know I can manually loop through each entry in the array. With 17 million entries, that would take quite a while I believe...