class_docstr: State Critic input for a single substep of the env, holding the tensor_dict and the actor_ids corresponding to where
  the embedding logits where retrieved if applicable, otherwise just the corresponding actor.
  
  The tensor dict here holds the observations of the corresponding env-sub-step as well as logits coming from the
  actor if a shared embedding is used.
docstr: Build the critic input for an individual step, by combining the policy step output and the given observation.
  
  :param policy_step_output: The output of the corresponding policy ot check for shared embedding outputs.
  :param observation: The observation as the default input to the critic.
  
  :return: The Critic input for this specific step.
docstr_tok: ["Build","the","critic","input","for","an","individual","step",",","by","combining","the","policy","step","output","and","the","given","observation",".",":","param","policy_step_output",":","The","output","of","the","corresponding","policy","ot","check","for","shared","embedding","outputs",".",":","param","observation",":","The","observation","as","the","default","input","to","the","critic",".",":","return",":","The","Critic","input","for","this","specific","step","."]
code: def build(
      cls,
      policy_step_output: PolicySubStepOutput,
      observation: TorchObservationType,
  ) -> "StateCriticStepInput":
      """Build the critic input for an individual step, by combining the policy step output and the given observation.
  
      :param policy_step_output: The output of the corresponding policy ot check for shared embedding outputs.
      :param observation: The observation as the default input to the critic.
  
      :return: The Critic input for this specific step.
      """
      if policy_step_output.embedding_logits is not None:
          combined_keys = list(
              policy_step_output.embedding_logits.keys()
          ) + list(observation.keys())
          assert len(set(combined_keys)) == len(combined_keys), (
              f"Duplicates in critic input found, please make sure that no shared embedding keys/outputs have the "
              f"same name as any observation."
          )
          combined_logits = policy_step_output.embedding_logits
          combined_logits.update(observation)
          return cls(
              tensor_dict=combined_logits,
              actor_id=policy_step_output.actor_id,
          )
      else:
          return cls(
              tensor_dict=observation,
              actor_id=policy_step_output.actor_id,
          )
  
imports: import dataclasses
  from typing import List, Sequence, Dict
  import torch
  from maze.core.agent.torch_policy_output import PolicySubStepOutput, PolicyOutput
  from maze.core.env.observation_conversion import TorchObservationType
  from maze.core.env.structured_env import ActorID
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
label_desc: Use image node_id 1 for calling the StateCriticStepInput obj's underlying member method code with example usage: obj.build(cls, policy_step_output, observation) and returns: cls, cls