class_docstr: Avalanche Dataset.
  
  Avlanche dataset are pytorch-compatible Datasets with some additional
  functionality such as:
  - management of transformation groups via :class:`AvalancheTransform`
  - support for sample attributes such as class targets and task labels
  
  Data Attributes
  ---------------
  
  Avalanche datasets manage sample-wise information such as class or task
  labels via :class:`DataAttribute`.
  
  Transformation Groups
  ---------------------
  
  Avalanche datasets manage transformation via transformation groups.
  Simply put, a transformation group is a named preprocessing function
  (as in torchvision datasets). By default, Avalanche expects
  two transformation groups:
  - 'train', which contains transformations applied to training patterns.
  - 'eval', that contain transformations applied to test patterns.
  
  Having both groups allows to use different transformations during training
  and evaluation and to seamlessly switch between them by using the
  :func:`train` and :func:`eval` methods. Arbitrary transformation groups
  can be added and used.  If you define custom groups, you can use them by
  calling the `:func:with_transforms` method.
  
  switching to a different transformation group by calling the ``train()``,
  ``eval()`` or ``with_transforms` methods always returns a new dataset,
  levaing the original one unchanged.
  
  Ttransformation groups can be manipulated by removing, freezing, or
  replacing transformations. Each operation returns a new dataset, leaving
  the original one unchanged.
class_docstr_tok: ["Avalanche","Dataset",".","Avlanche","dataset","are","pytorch-compatible","Datasets","with","some","additional","functionality","such","as",":","-","management","of","transformation","groups","via",":","class",":","`","AvalancheTransform","`","-","support","for","sample","attributes","such","as","class","targets","and","task","labels","Data","Attributes","--","--","--","--","--","--","--","-","Avalanche","datasets","manage","sample-wise","information","such","as","class","or","task","labels","via",":","class",":","`","DataAttribute","`",".","Transformation","Groups","--","--","--","--","--","--","--","--","--","--","-","Avalanche","datasets","manage","transformation","via","transformation","groups",".","Simply","put",",","a","transformation","group","is","a","named","preprocessing","function","(","as","in","torchvision","datasets",")",".","By","default",",","Avalanche","expects","two","transformation","groups",":","-","'train","'",",","which","contains","transformations","applied","to","training","patterns",".","-","'eval","'",",","that","contain","transformations","applied","to","test","patterns",".","Having","both","groups","allows","to","use","different","transformations","during","training","and","evaluation","and","to","seamlessly","switch","between","them","by","using","the",":","func",":","`","train","`","and",":","func",":","`","eval","`","methods",".","Arbitrary","transformation","groups","can","be","added","and","used",".","If","you","define","custom","groups",",","you","can","use","them","by","calling","the","`",":","func",":","with_transforms","`","method",".","switching","to","a","different","transformation","group","by","calling","the","``","train","(",")","``",",","``","eval","(",")","``","or","``","with_transforms","`","methods","always","returns","a","new","dataset",",","levaing","the","original","one","unchanged",".","Ttransformation","groups","can","be","manipulated","by","removing",",","freezing",",","or","replacing","transformations",".","Each","operation","returns","a","new","dataset",",","leaving","the","original","one","unchanged","."]
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: TAvalancheDataset) -> TAvalancheDataset:
      """Returns a new dataset with the transformation groups frozen."""
      datacopy = self._shallow_clone_dataset()
      datacopy._flat_data = datacopy._flat_data.freeze_transforms()
      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 17 for calling the AvalancheDataset obj's underlying member method code with example usage: obj.freeze_transforms() and returns: datacopy