Skip to content

Commit

Permalink
fix toy real function data layer
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <[email protected]>
  • Loading branch information
yzhang123 committed Apr 1, 2020
1 parent 30d9497 commit e90da39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nemo/backends/pytorch/tutorials/toys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,)
Expand Down

0 comments on commit e90da39

Please sign in to comment.