keras/src/trainers/data_adapters/array_data_adapter.py/ArrayDataset/slice_and_convert
class ArrayDataset:            def __getitems__(self, indices):
                def slice_and_convert(sliceable):
                    x = sliceable[indices]
                    x = sliceable.convert_to_torch_compatible(x)
                    x = convert_to_tensor(x)
                    return x

                return tree.map_structure(slice_and_convert, self.array)