class_docstr: Base Experience.
  
  Experiences have an index which track the experience's position
  inside the stream for evaluation purposes.
class_docstr_tok: ["Base","Experience",".","Experiences","have","an","index","which","track","the","experience","'s","position","inside","the","stream","for","evaluation","purposes","."]
docstr: The task label. This value will never have value "None". However,
  for scenarios that don't produce task labels a placeholder value like 0
  is usually set. Beware that this field is meant as a shortcut to obtain
  a unique task label: it assumes that only patterns labeled with a
  single task label are present. If this experience contains patterns from
  multiple tasks, accessing this property will result in an exception.
docstr_tok: ["The","task","label",".","This","value","will","never","have","value","``","None","''",".","However",",","for","scenarios","that","do","n't","produce","task","labels","a","placeholder","value","like","0","is","usually","set",".","Beware","that","this","field","is","meant","as","a","shortcut","to","obtain","a","unique","task","label",":","it","assumes","that","only","patterns","labeled","with","a","single","task","label","are","present",".","If","this","experience","contains","patterns","from","multiple","tasks",",","accessing","this","property","will","result","in","an","exception","."]
code: def task_label(self) -> int:
      """
      The task label. This value will never have value "None". However,
      for scenarios that don't produce task labels a placeholder value like 0
      is usually set. Beware that this field is meant as a shortcut to obtain
      a unique task label: it assumes that only patterns labeled with a
      single task label are present. If this experience contains patterns from
      multiple tasks, accessing this property will result in an exception.
      """
      if len(self.task_labels) != 1:
          raise ValueError(
              "The task_label property can only be accessed "
              "when the experience contains a single task label"
          )
  
      return self.task_labels[0]
  
file_path: avalanche/avalanche/benchmarks/scenarios/deprecated/__init__.py
imports: from abc import ABC
  from typing import Generic, List, Optional, Sequence, TypeVar
  from ..None import CLExperience, CLStream, CLScenario
  from typing import TYPE_CHECKING
label_desc: Use image node_id 6 for calling the DatasetExperience obj's underlying member method code with example usage: obj.task_label() and returns: self