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: Recursively remove the current transformation group from the
  dataset tree and replaces it.
docstr_tok: ["Recursively","remove","the","current","transformation","group","from","the","dataset","tree","and","replaces","it","."]
code: def replace_current_transform_group(self, transform):
      """Recursively remove the current transformation group from the
      dataset tree and replaces it."""
      dataset_copy = self.remove_current_transform_group()
      cgroup = dataset_copy._transform_groups.current_group
      dataset_copy._transform_groups[cgroup] = transform
      dds = []
      for dd in dataset_copy._datasets:
          if isinstance(dd, _FlatDataWithTransform):
              dds.append(dd.remove_current_transform_group())
          else:
              dds.append(dd)
      dataset_copy._datasets = dds
      return dataset_copy
  
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 8 for calling the _FlatDataWithTransform obj's underlying member method code with example usage: obj.replace_current_transform_group(transform) and returns: dataset_copy