Skip to content
Snippets Groups Projects

Making use of LightningDataModule and simplification of data loading

Merged Daniel CARRON requested to merge add-datamodule into main
Compare and Show latest version
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
@@ -49,7 +49,8 @@ def _sample_size_bytes(s: Sample) -> int:
"""Returns a tensor size in bytes."""
return int(t.element_size() * torch.prod(torch.tensor(t.shape)))
size = int(s[0].element_size() * torch.prod(torch.tensor(s[0].shape)))
size = sys.getsizeof(s[0]) # tensor metadata
size += int(s[0].element_size() * torch.prod(torch.tensor(s[0].shape)))
size += sys.getsizeof(s[1])
# check each element - if it is a tensor, then adds its total space in
Loading