The usage of compose of transformations with map_items = False is omitted
When using the CacheDataset the _load_cache_item method is called, but there the Compose.map_items is not used and therefore all the transformations are applied to all data even though the data is a list or tuple.
def _load_cache_item(self, idx: int):
"""
Args:
idx: the index of the input data sequence.
"""
item = self.data[idx]
for _transform in self.transform.transforms:
# execute all the deterministic transforms
if isinstance(_transform, RandomizableTrait) or not isinstance(_transform, Transform):
break
_xform = deepcopy(_transform) if isinstance(_transform, ThreadUnsafe) else _transform
item = apply_transform(_xform, item)
if self.as_contiguous:
item = convert_to_contiguous(item, memory_format=torch.contiguous_format)
return item
The usage of compose of transformations with
map_items = Falseis omittedWhen using the CacheDataset the
_load_cache_itemmethod is called, but there theCompose.map_itemsis not used and therefore all the transformations are applied to all data even though the data is a list or tuple.