Since you’ve already loaded the data as a numpy array, you should be able to use:
X = torch.from_numpy(data)

Note that this method will share the underlying storage. If you change X inplace, these changes will also be applied to data.
If you don’t want this behavior, use torch.from_numpy(data).clone(), which will create a copy.