class_docstr: A simple FC model that takes the last n observations as input.
class_docstr_tok: ["A","simple","FC","model","that","takes","the","last","n","observations","as","input","."]
code: def __init__(
      self,
      obs_space,
      action_space,
      num_outputs,
      model_config,
      name,
      num_frames=3,
  ):
      nn.Module.__init__(self)
      super(TorchFrameStackingCartPoleModel, self).__init__(
          obs_space, action_space, None, model_config, name
      )
  
      self.num_frames = num_frames
      self.num_outputs = num_outputs
  
      # Construct actual (very simple) FC model.
      assert len(obs_space.shape) == 1
      in_size = self.num_frames * (
          obs_space.shape[0] + action_space.n + 1
      )
      self.layer1 = SlimFC(
          in_size=in_size, out_size=256, activation_fn="relu"
      )
      self.layer2 = SlimFC(
          in_size=256, out_size=256, activation_fn="relu"
      )
      self.out = SlimFC(
          in_size=256, out_size=self.num_outputs, activation_fn="linear"
      )
      self.values = SlimFC(
          in_size=256, out_size=1, activation_fn="linear"
      )
  
      self._last_value = None
  
      self.view_requirements["prev_n_obs"] = ViewRequirement(
          data_col="obs",
          shift="-{}:0".format(num_frames - 1),
          space=obs_space,
      )
      self.view_requirements["prev_n_rewards"] = ViewRequirement(
          data_col="rewards", shift="-{}:-1".format(self.num_frames)
      )
      self.view_requirements["prev_n_actions"] = ViewRequirement(
          data_col="actions",
          shift="-{}:-1".format(self.num_frames),
          space=self.action_space,
      )
  
file_path: ray/python/ray/rllib/examples/models/trajectory_view_utilizing_models.py
imports: from ray.rllib.models.tf.tf_modelv2 import TFModelV2
  from ray.rllib.models.torch.misc import SlimFC
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.policy.view_requirement import ViewRequirement
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
  from ray.rllib.utils.tf_utils import one_hot
  from ray.rllib.utils.torch_utils import one_hot
label_desc: Use image node_id 1 to create a new TorchFrameStackingCartPoleModel object from inherited base classes: TorchModelV2, nn with example: obj = TorchFrameStackingCartPoleModel(obs_space, action_space, num_outputs, model_config, name, num_frames)