Skip to content

Commit

Permalink
Remove explicit shared memory conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
aliubimov committed Jan 13, 2022
1 parent 6d4693d commit 9c7cbe9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions hub/integrations/pytorch/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ def _worker_loop(
data = next(it)

data = _process(data, transform)
data = {
k: torch.as_tensor(v).share_memory_() for k, v in data.items()
}
data = {k: torch.as_tensor(v) for k, v in data.items()}

data_queue.put((wid, data))
requested -= 1
Expand Down Expand Up @@ -471,10 +469,7 @@ def __iter__(self):

for i in range(len(next_batch[batch_keys[0]])):
val = IterableOrderedDict(
{
k: next_batch[k][i].clone().detach().share_memory_()
for k in batch_keys
}
{k: next_batch[k][i].clone().detach() for k in batch_keys}
)

if buffer is not None:
Expand Down

0 comments on commit 9c7cbe9

Please sign in to comment.