class_docstr: Data attributes manage sample-wise information such as task or
  class labels.
  
  It provides access to unique values (`self.uniques`) and their indices
  (`self.val_to_idx`). Both fields are initialized lazily.
  
  Data attributes can be efficiently concatenated and subsampled.
class_docstr_tok: ["Data","attributes","manage","sample-wise","information","such","as","task","or","class","labels",".","It","provides","access","to","unique","values","(","`","self.uniques","`",")","and","their","indices","(","`","self.val_to_idx","`",")",".","Both","fields","are","initialized","lazily",".","Data","attributes","can","be","efficiently","concatenated","and","subsampled","."]
docstr: Data Attribute.
  
  :param data: a sequence of values, one for each sample.
  :param name: a name that uniquely identifies the attribute.
      It is used by `AvalancheDataset` to dynamically add it to its
      attributes.
  :param use_in_getitem: If True, `AvalancheDataset` will add
      the value at the end of each sample.
docstr_tok: ["Data","Attribute",".",":","param","data",":","a","sequence","of","values",",","one","for","each","sample",".",":","param","name",":","a","name","that","uniquely","identifies","the","attribute",".","It","is","used","by","`","AvalancheDataset","`","to","dynamically","add","it","to","its","attributes",".",":","param","use_in_getitem",":","If","True",",","`","AvalancheDataset","`","will","add","the","value","at","the","end","of","each","sample","."]
code: def __init__(
      self,
      data: IDataset[T_co],
      name: str,
      use_in_getitem: bool = False,
  ):
      """Data Attribute.
  
      :param data: a sequence of values, one for each sample.
      :param name: a name that uniquely identifies the attribute.
          It is used by `AvalancheDataset` to dynamically add it to its
          attributes.
      :param use_in_getitem: If True, `AvalancheDataset` will add
          the value at the end of each sample.
      """
      assert name is not None
      assert data is not None
  
      self.name: str = name
      self.use_in_getitem: bool = use_in_getitem
  
      self._data: FlatData[T_co] = self._normalize_sequence(data)
  
      self._uniques: Optional[Set[T_co]] = None  # set()
      self._val_to_idx: Optional[
          Dict[T_co, Sequence[int]]
      ] = None  # dict()
      self._count: Optional[Dict[T_co, int]] = None
  
imports: from typing import Dict, List, Optional, Sequence, Set, TypeVar, Union, overload
  import torch
  from .dataset_definitions import IDataset
  from .flat_data import ConstantSequence, FlatData
label_desc: Use image node_id 1 to create a new DataAttribute object from inherited base classes: IDataset, Sequence with example: obj = DataAttribute(data, name, use_in_getitem)