class_docstr: Private class used to wrap a dataset with a transformation group.
  
  Do not use outside of this file.
class_docstr_tok: ["Private","class","used","to","wrap","a","dataset","with","a","transformation","group",".","Do","not","use","outside","of","this","file","."]
docstr: Returns a new dataset with the transformation groups frozen.
docstr_tok: ["Returns","a","new","dataset","with","the","transformation","groups","frozen","."]
code: def freeze_transforms(self: TDataWTransform) -> TDataWTransform:
      """Returns a new dataset with the transformation groups frozen."""
      tgroups = copy.copy(self._transform_groups)
      frozen_tgroups = copy.copy(self._frozen_transform_groups)
      datacopy = self._shallow_clone_dataset()
      datacopy._frozen_transform_groups = frozen_tgroups + tgroups
      datacopy._transform_groups = EmptyTransformGroups()
      dds: List[IDataset] = []
      for dd in datacopy._datasets:
          if isinstance(dd, _FlatDataWithTransform):
              dds.append(dd.freeze_transforms())
          else:
              dds.append(dd)
      datacopy._datasets = dds
      return datacopy
  
imports: import copy
  import warnings
  import numpy
  from torch.utils.data.dataloader import default_collate
  from avalanche.benchmarks.utils.dataset_definitions import IDataset
  from .data_attribute import DataAttribute
  from typing import Dict, List, Any, Optional, Sequence, TypeVar, Callable, Union, overload
  from .flat_data import FlatData
  from .transform_groups import TransformGroups, EmptyTransformGroups
  from torch.utils.data import Dataset
  from collections import OrderedDict
label_desc: Use image node_id 6 for calling the _FlatDataWithTransform obj's underlying member method code with example usage: obj.freeze_transforms() and returns: datacopy