class_docstr: State Critic output defined as it's own type, since it has to be explicitly build to be compatible with shared
  embedding networks.
docstr: Build the critic input from the policy outputs and the spaces record (policy input).
  
  This method is responsible for building a List that hold the appropriate input for each critic w.r.t. the
  substep and the shared-embedding-keys.
  
  :param policy_output: The full policy output.
  :param record: The structured spaces record used to compute the policy output.
  :return: A Critic input.
docstr_tok: ["Build","the","critic","input","from","the","policy","outputs","and","the","spaces","record","(","policy","input",")",".","This","method","is","responsible","for","building","a","List","that","hold","the","appropriate","input","for","each","critic","w.r.t",".","the","substep","and","the","shared-embedding-keys",".",":","param","policy_output",":","The","full","policy","output",".",":","param","record",":","The","structured","spaces","record","used","to","compute","the","policy","output",".",":","return",":","A","Critic","input","."]
code: def build(
      cls, policy_output: PolicyOutput, record: StructuredSpacesRecord
  ) -> "StateCriticInput":
      """Build the critic input from the policy outputs and the spaces record (policy input).
  
      This method is responsible for building a List that hold the appropriate input for each critic w.r.t. the
      substep and the shared-embedding-keys.
  
      :param policy_output: The full policy output.
      :param record: The structured spaces record used to compute the policy output.
      :return: A Critic input.
      """
      critic_input = StateCriticInput()
      for idx, substep_record in enumerate(record.substep_records):
          assert substep_record.actor_id == policy_output[idx].actor_id
          critic_input.append(
              StateCriticStepInput.build(
                  policy_output[idx], substep_record.observation
              )
          )
  
      return critic_input
  
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 7 for calling the StateCriticInput obj's underlying member method code with example usage: obj.build(cls, policy_output, record) and returns: critic_input