Why does using a numpy array instead of a torch tensor use more memory in this example?
Using this method gives me a train_data size of about 700Mb and test of about 200Mb
data_tensor = torch.Tensor([np.repeat(image[...,np.newaxis],3,-1)/255.0 for image in data])

np.save(f&quot;/home/vedank/Desktop/code/facial_sentiment/{dataset_type}_data.npy&quot;,np.array(data_tensor))

However, using the one below increases the size of train_data to 1.6 Gb and test to ~400Mb
data_tensor = np.array([np.repeat(image[...,np.newaxis],3,-1)/255.0 for image in data])

np.save(f&quot;/home/vedank/Desktop/code/facial_sentiment/{dataset_type}_data.npy&quot;,data_tensor)


It seems that the default datatype for numpy (float) arrays is 64 bits.
import numpy as np 
print(np.array([2.3]).dtype)
# we get float 64

on the other hand, pytorch default float datatype is float32
That means the size of the array in numpy should be double the one in PyTorch.
