class_docstr: Wrapper around it's environment, to simplify configuration.
class_docstr_tok: ["Wrapper","around","it","'s","environment",",","to","simplify","configuration","."]
code: def serving_action_extractor(
      self, actor_output: rlt.ActorOutput
  ) -> torch.Tensor:
      action = actor_output.action
      action_space = self.action_space
      assert (
          len(action.shape) == 2 and action.shape[0] == 1
      ), f"{action.shape} isn't (1, action_dim)"
      if isinstance(action_space, spaces.Discrete):
          return action.squeeze(0).argmax().view([])
      elif isinstance(action_space, spaces.MultiDiscrete):
          return action.squeeze(0)
      elif isinstance(action_space, spaces.Box):
          assert (
              len(action_space.shape) == 1
          ), f"Unsupported Box with shape {action_space.shape}"
          return action.squeeze(0)
      else:
          raise NotImplementedError(
              f"Unsupported action space: {action_space}"
          )
  
imports: import abc
  import logging
  from typing import Callable, Optional
  import gym
  import numpy
  import reagent.core.types
  import torch
  from gym import spaces
  from reagent.core.dataclasses import dataclass
  from reagent.core.parameters import CONTINUOUS_TRAINING_ACTION_RANGE
  from reagent.core.registry_meta import RegistryMeta
  from reagent.training.utils import rescale_actions
label_desc: Use image node_id 8 for calling the EnvWrapper obj's underlying member method code with example usage: obj.serving_action_extractor(actor_output) and returns: action, action, action