According to the docs 1:
class ToTensor(object):
    """Convert a ``PIL.Image`` or ``numpy.ndarray`` to tensor.

    Converts a PIL.Image or numpy.ndarray (H x W x C) in the range
    [0, 255] to a torch.FloatTensor of shape (C x H x W) in the range [0.0, 1.0].
    """

but I’m getting a DoubleTensor from a numpy array I saved. Why? How does one fix this?
My class:

class MyData(torch.utils.data.Dataset):
    def __init__(self,path_train,path_test=None,transform=None):
        self.transform = transform
        ## train
        np_train_data = np.load(path_train)
        self.X_train = np_train_data['X_train']
        self.Y_train = np_train_data['Y_train']
        ## test
        self.test = None
        if path_test is not None:
            np_train_data = np.load(path_train)
            self.X_train = np_train_data['X_test']
            self.Y_train = np_train_data['Y_test']

    def __getitem__(self, index):
        data = self.X_train[index]
        target = self.Y_train[index]
        if self.transform is not None:
            data = self.transform(data)
        print(data.type())
        return data,target
        #return data, target, index

    def __len__(self):
        return len(self.X_train)