class_docstr: A lazy mapping for <task-label -> task dataset>.
  
  Given an `AvalancheClassificationDataset`, this class provides an
  iterator that splits the data into task subsets, returning tuples
  `<task_id, task_dataset>`.
  
  Usage:
  
  .. code-block:: python
  
      tset = TaskSet(data)
      for tid, tdata in tset:
          print(f"task {tid} has {len(tdata)} examples.")
class_docstr_tok: ["A","lazy","mapping","for","<","task-label","-",">","task","dataset",">",".","Given","an","`","AvalancheClassificationDataset","`",",","this","class","provides","an","iterator","that","splits","the","data","into","task","subsets",",","returning","tuples","`","<","task_id",",","task_dataset",">","`",".","Usage",":","..","code-block",":",":","python","tset","=","TaskSet","(","data",")","for","tid",",","tdata","in","tset",":","print","(","f","''","task","{","tid","}","has","{","len","(","tdata",")","}","examples",".","''",")"]
code: def _get_task_labels_field(self) -> DataAttribute[int]:
      return self.data.targets_task_labels
  
imports: from collections import OrderedDict, defaultdict, deque
  from typing import TYPE_CHECKING, Any, Callable, Generic, Iterator, List, Iterable, Mapping, Optional, Sequence, TypeVar, Union, Dict, SupportsInt
  import warnings
  import torch
  from torch import Tensor
  from torch.utils.data import Subset, ConcatDataset
  from .data import AvalancheDataset
  from .data_attribute import DataAttribute
  from .dataset_definitions import ISupportedClassificationDataset
  from .dataset_utils import SubSequence, find_list_from_index
  from .flat_data import ConstantSequence
  from .transform_groups import TransformGroupDef, TransformGroups, XTransform, YTransform
label_desc: Use image node_id 5 for calling the TaskSet obj's underlying member method code with example usage: obj._get_task_labels_field() and returns: self