From e90da398da30fcb2db34e66b2ff3a5ce1cfd3088 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Wed, 1 Apr 2020 12:20:15 -0700 Subject: [PATCH] fix toy real function data layer Signed-off-by: Yang Zhang --- nemo/backends/pytorch/tutorials/toys.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nemo/backends/pytorch/tutorials/toys.py b/nemo/backends/pytorch/tutorials/toys.py index 817658cd4518..c3d9027b180e 100644 --- a/nemo/backends/pytorch/tutorials/toys.py +++ b/nemo/backends/pytorch/tutorials/toys.py @@ -154,9 +154,8 @@ def __init__(self, batch_size, f_name="sin", n=1000, x_lo=-4, x_hi=4): self._n = n self._batch_size = batch_size - self._device = t.device("cuda" if self.placement == DeviceType.GPU else "cpu") - x_data = t.tensor(np.random.uniform(low=x_lo, high=x_hi, size=self._n)).unsqueeze(-1).to(self._device) + x_data = t.tensor(np.random.uniform(low=x_lo, high=x_hi, size=self._n)).unsqueeze(-1) y_data = func(x_data) self._dataset = t_utils.TensorDataset(x_data.float(), y_data.float()) self._data_iterator = t_utils.DataLoader(self._dataset, batch_size=self._batch_size,)