class_docstr: Encapsulates multiple torch state critics for training in structured environments.
  
  :param networks: Mapping of value functions (critic) to encapsulate.
  :param obs_spaces_dict: The observation spaces dict of the environment.
  :param device: Device the policy should be located on (cpu or cuda).
class_docstr_tok: ["Encapsulates","multiple","torch","state","critics","for","training","in","structured","environments",".",":","param","networks",":","Mapping","of","value","functions","(","critic",")","to","encapsulate",".",":","param","obs_spaces_dict",":","The","observation","spaces","dict","of","the","environment",".",":","param","device",":","Device","the","policy","should","be","located","on","(","cpu","or","cuda",")","."]
docstr: Compute bootstrapped return for the whole structured step (i.e., all sub-steps).
  
  :param gamma: Discounting factor
  :param gae_lambda: Bias vs variance trade of factor for Generalized Advantage Estimator (GAE)
  :param rewards: List of sub-step rewards, each with shape (n_steps, n_workers)
  :param values: List of sub-step detached values, each with shape (n_steps, n_workers)
  :param dones: Step dones with shape (n_steps, n_workers)
  :return: List of per-time sub-step returns
docstr_tok: ["Compute","bootstrapped","return","for","the","whole","structured","step","(","i.e.",",","all","sub-steps",")",".",":","param","gamma",":","Discounting","factor",":","param","gae_lambda",":","Bias","vs","variance","trade","of","factor","for","Generalized","Advantage","Estimator","(","GAE",")",":","param","rewards",":","List","of","sub-step","rewards",",","each","with","shape","(","n_steps",",","n_workers",")",":","param","values",":","List","of","sub-step","detached","values",",","each","with","shape","(","n_steps",",","n_workers",")",":","param","dones",":","Step","dones","with","shape","(","n_steps",",","n_workers",")",":","return",":","List","of","per-time","sub-step","returns"]
code: def compute_structured_return(
      self,
      gamma: float,
      gae_lambda: float,
      rewards: List[torch.Tensor],
      values: List[torch.Tensor],
      dones: torch.Tensor,
  ) -> List[torch.Tensor]:
      """Compute bootstrapped return for the whole structured step (i.e., all sub-steps).
  
      :param gamma: Discounting factor
      :param gae_lambda: Bias vs variance trade of factor for Generalized Advantage Estimator (GAE)
      :param rewards: List of sub-step rewards, each with shape (n_steps, n_workers)
      :param values: List of sub-step detached values, each with shape (n_steps, n_workers)
      :param dones: Step dones with shape (n_steps, n_workers)
      :return: List of per-time sub-step returns
      """
  
imports: from abc import abstractmethod
  from typing import Mapping, Union, List, Dict
  import torch
  from gym import spaces
  from torch import nn
  from maze.core.agent.state_critic import StateCritic
  from maze.core.agent.state_critic_input_output import StateCriticStepOutput, StateCriticOutput, StateCriticInput
  from maze.core.agent.torch_model import TorchModel
  from maze.core.annotations import override
  from maze.core.env.observation_conversion import ObservationType
  from maze.core.env.structured_env import StepKeyType
  from maze.perception.perception_utils import convert_to_torch, flatten_spaces, stack_and_flatten_spaces
label_desc: Use image node_id 11 for calling the TorchStateCritic obj's underlying member method code with example usage: obj.compute_structured_return(gamma, gae_lambda, rewards, values, dones) without return types