class_docstr: Online CL (OCL) Experience.
  
  OCL experiences are created by splitting a larger experience. Therefore,
  they keep track of the original experience for logging purposes.
class_docstr_tok: ["Online","CL","(","OCL",")","Experience",".","OCL","experiences","are","created","by","splitting","a","larger","experience",".","Therefore",",","they","keep","track","of","the","original","experience","for","logging","purposes","."]
docstr: A class representing a continual learning experience in an online
  setting.
  
  :param current_experience: The index of the current experience.
  :type current_experience: int
  :param dataset: The dataset containing the experience.
  :type dataset: TCLDataset
  :param origin_experience: The original experience from which this
      experience was derived.
  :type origin_experience: DatasetExperience
  :param is_first_subexp: Whether this is the first sub-experience.
  :type is_first_subexp: bool, optional
  :param is_last_subexp: Whether this is the last sub-experience.
  :type is_last_subexp: bool, optional
  :param sub_stream_length: The length of the sub-stream.
  :type sub_stream_length: int, optional
  :param access_task_boundaries: Whether to access task boundaries.
  :type access_task_boundaries: bool, optional
docstr_tok: ["A","class","representing","a","continual","learning","experience","in","an","online","setting",".",":","param","current_experience",":","The","index","of","the","current","experience",".",":","type","current_experience",":","int",":","param","dataset",":","The","dataset","containing","the","experience",".",":","type","dataset",":","TCLDataset",":","param","origin_experience",":","The","original","experience","from","which","this","experience","was","derived",".",":","type","origin_experience",":","DatasetExperience",":","param","is_first_subexp",":","Whether","this","is","the","first","sub-experience",".",":","type","is_first_subexp",":","bool",",","optional",":","param","is_last_subexp",":","Whether","this","is","the","last","sub-experience",".",":","type","is_last_subexp",":","bool",",","optional",":","param","sub_stream_length",":","The","length","of","the","sub-stream",".",":","type","sub_stream_length",":","int",",","optional",":","param","access_task_boundaries",":","Whether","to","access","task","boundaries",".",":","type","access_task_boundaries",":","bool",",","optional"]
code: def __init__(
      self: TOnlineCLExperience,
      *,
      dataset: TCLDataset,
      origin_experience: DatasetExperience,
      is_first_subexp: bool = False,
      is_last_subexp: bool = False,
      sub_stream_length: Optional[int] = None,
      access_task_boundaries: bool = False,
  ):
      """A class representing a continual learning experience in an online
      setting.
  
      :param current_experience: The index of the current experience.
      :type current_experience: int
      :param dataset: The dataset containing the experience.
      :type dataset: TCLDataset
      :param origin_experience: The original experience from which this
          experience was derived.
      :type origin_experience: DatasetExperience
      :param is_first_subexp: Whether this is the first sub-experience.
      :type is_first_subexp: bool, optional
      :param is_last_subexp: Whether this is the last sub-experience.
      :type is_last_subexp: bool, optional
      :param sub_stream_length: The length of the sub-stream.
      :type sub_stream_length: int, optional
      :param access_task_boundaries: Whether to access task boundaries.
      :type access_task_boundaries: bool, optional
      """
      super().__init__(dataset=dataset)
      self.access_task_boundaries = access_task_boundaries
      self.origin_experience: DatasetExperience = origin_experience
      self.subexp_size: int = len(dataset)
      self.is_first_subexp: bool = is_first_subexp
      self.is_last_subexp: bool = is_last_subexp
      self.sub_stream_length: Optional[int] = sub_stream_length
  
      self._as_attributes(
          "origin_experience",
          "subexp_size",
          "is_first_subexp",
          "is_last_subexp",
          "sub_stream_length",
          use_in_train=access_task_boundaries,
          use_in_eval=access_task_boundaries,
      )
  
imports: from functools import partial
  import random
  from typing import Callable, Generator, Generic, Iterable, List, Optional, TypeVar, Union, Protocol
  from typing_extensions import Literal
  import warnings
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.benchmarks.utils.utils import concat_datasets
  import torch
  from torch.distributions.categorical import Categorical
  from torch.utils.data import Sampler
  from .deprecated.benchmark_wrapper_utils import wrap_stream
  from .generic_scenario import CLStream, CLScenario
  from .dataset_scenario import DatasetExperience
label_desc: Use image node_id 1 to create a new OnlineCLExperience object from inherited base classes: DatasetExperience, Generic with example: obj = OnlineCLExperience()