Skip to content

Commit

Permalink
corrected tensor calculation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
levongh committed May 10, 2023
1 parent 90d0614 commit 6bd93f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deeplake/integrations/pytorch/shuffle_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def _num_torch_tensors(self, sample):
return 0
if isinstance(sample, TorchTensor):
return 1
elif isinstance(sample, bytes):
return 0
elif isinstance(sample, dict):
return sum(self._num_torch_tensors(tensor) for tensor in sample.values())
elif isinstance(sample, Sequence):
Expand Down

0 comments on commit 6bd93f3

Please sign in to comment.