class_docstr: Base class defining the API for an individual "connector piece".
  
  A ConnectorV2 ("connector piece") is usually part of a whole series of connector
  pieces within a so-called connector pipeline, which in itself also abides to this
  very API..
  For example, you might have a connector pipeline consisting of two connector pieces,
  A and B, both instances of subclasses of ConnectorV2 and each one performing a
  particular transformation on their input data. The resulting connector pipeline
  (A->B) itself also abides to this very ConnectorV2 API and could thus be part of yet
  another, higher-level connector pipeline.
  
  Any ConnectorV2 instance (individual pieces or several connector pieces in a
  pipeline) is a callable and you should override their `__call__()` method.
  When called, they take the outputs of a previous connector piece (or an empty dict
  if there are no previous pieces) as well as all the data collected thus far in the
  ongoing episode(s) (only applies to connectors used in EnvRunners) or retrieved
  from a replay buffer or from an environment sampling step (only applies to
  connectors used in Learner pipelines). From this input data, a ConnectorV2 then
  performs a transformation step.
  
  There are 3 types of pipelines any ConnectorV2 piece can belong to:
  1) EnvToModulePipeline: The connector transforms environment data before it gets to
  the RLModule. This type of pipeline is used by an EnvRunner for transforming
  env output data into RLModule readable data (for the next RLModule forward pass).
  For example, such a pipeline would include observation postprocessors, -filters,
  or any RNN preparation code related to time-sequences and zero-padding.
  2) ModuleToEnvPipeline: This type of pipeline is used by an
  EnvRunner to transform RLModule output data to env readable actions (for the next
  `env.step()` call). For example, in case the RLModule only outputs action
  distribution parameters (but not actual actions), the ModuleToEnvPipeline would
  take care of sampling the actions to be sent back to the end from the
  resulting distribution (made deterministic if exploration is off).
  3) LearnerConnectorPipeline: This connector pipeline type transforms data coming
  from an `EnvRunner.sample()` call or a replay buffer and will then be sent into the
  RLModule's `forward_train()` method in order to compute loss function inputs.
  This type of pipeline is used by a Learner worker to transform raw training data
  (a batch or a list of episodes) to RLModule readable training data (for the next
  RLModule `forward_train()` call).
  
  Some connectors might be stateful, for example for keeping track of observation
  filtering stats (mean and stddev values). Any Algorithm, which uses connectors is
  responsible for frequently synchronizing the states of all connectors and connector
  pipelines between the EnvRunners (owning the env-to-module and module-to-env
  pipelines) and the Learners (owning the Learner pipelines).
class_docstr_tok: ["Base","class","defining","the","API","for","an","individual","``","connector","piece","''",".","A","ConnectorV2","(","``","connector","piece","''",")","is","usually","part","of","a","whole","series","of","connector","pieces","within","a","so-called","connector","pipeline",",","which","in","itself","also","abides","to","this","very","API","..","For","example",",","you","might","have","a","connector","pipeline","consisting","of","two","connector","pieces",",","A","and","B",",","both","instances","of","subclasses","of","ConnectorV2","and","each","one","performing","a","particular","transformation","on","their","input","data",".","The","resulting","connector","pipeline","(","A-",">","B",")","itself","also","abides","to","this","very","ConnectorV2","API","and","could","thus","be","part","of","yet","another",",","higher-level","connector","pipeline",".","Any","ConnectorV2","instance","(","individual","pieces","or","several","connector","pieces","in","a","pipeline",")","is","a","callable","and","you","should","override","their","`","__call__","(",")","`","method",".","When","called",",","they","take","the","outputs","of","a","previous","connector","piece","(","or","an","empty","dict","if","there","are","no","previous","pieces",")","as","well","as","all","the","data","collected","thus","far","in","the","ongoing","episode","(","s",")","(","only","applies","to","connectors","used","in","EnvRunners",")","or","retrieved","from","a","replay","buffer","or","from","an","environment","sampling","step","(","only","applies","to","connectors","used","in","Learner","pipelines",")",".","From","this","input","data",",","a","ConnectorV2","then","performs","a","transformation","step",".","There","are","3","types","of","pipelines","any","ConnectorV2","piece","can","belong","to",":","1",")","EnvToModulePipeline",":","The","connector","transforms","environment","data","before","it","gets","to","the","RLModule",".","This","type","of","pipeline","is","used","by","an","EnvRunner","for","transforming","env","output","data","into","RLModule","readable","data","(","for","the","next","RLModule","forward","pass",")",".","For","example",",","such","a","pipeline","would","include","observation","postprocessors",",","-filters",",","or","any","RNN","preparation","code","related","to","time-sequences","and","zero-padding",".","2",")","ModuleToEnvPipeline",":","This","type","of","pipeline","is","used","by","an","EnvRunner","to","transform","RLModule","output","data","to","env","readable","actions","(","for","the","next","`","env.step","(",")","`","call",")",".","For","example",",","in","case","the","RLModule","only","outputs","action","distribution","parameters","(","but","not","actual","actions",")",",","the","ModuleToEnvPipeline","would","take","care","of","sampling","the","actions","to","be","sent","back","to","the","end","from","the","resulting","distribution","(","made","deterministic","if","exploration","is","off",")",".","3",")","LearnerConnectorPipeline",":","This","connector","pipeline","type","transforms","data","coming","from","an","`","EnvRunner.sample","(",")","`","call","or","a","replay","buffer","and","will","then","be","sent","into","the","RLModule","'s","`","forward_train","(",")","`","method","in","order","to","compute","loss","function","inputs",".","This","type","of","pipeline","is","used","by","a","Learner","worker","to","transform","raw","training","data","(","a","batch","or","a","list","of","episodes",")","to","RLModule","readable","training","data","(","for","the","next","RLModule","`","forward_train","(",")","`","call",")",".","Some","connectors","might","be","stateful",",","for","example","for","keeping","track","of","observation","filtering","stats","(","mean","and","stddev","values",")",".","Any","Algorithm",",","which","uses","connectors","is","responsible","for","frequently","synchronizing","the","states","of","all","connectors","and","connector","pipelines","between","the","EnvRunners","(","owning","the","env-to-module","and","module-to-env","pipelines",")","and","the","Learners","(","owning","the","Learner","pipelines",")","."]
code: def __str__(self, indentation: int = 0):
      return " " * indentation + self.__class__.__name__
  
file_path: ray/rllib/connectors/connector_v2.py
imports: import abc
  from typing import Any, Dict, List, Optional
  import gymnasium
  from ray.rllib.connectors.input_output_types import INPUT_OUTPUT_TYPES
  from ray.rllib.core.rl_module.rl_module import RLModule
  from ray.rllib.utils.typing import EpisodeType
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 11 for calling the ConnectorV2 obj's underlying member method code with example usage: obj.__str__(indentation) and returns: unknown