code: def forward(self, obs):
      batch_size = obs["action_history"].size(0)
  
      seq = F.pad(
          obs["action_history"] + 1, (1, 1)
      )  # pad the start token and end token
      # end token is used to avoid out-of-range of v_s_. Will not actually affect BP.
      seq = self.embedding(seq.long())
  
      step_onehot = (
          F.one_hot(torch.arange(self.step_dim, device=seq.device))
          .unsqueeze(0)
          .repeat(batch_size, 1, 1)
      )
  
      feature, _ = self.rnn(torch.cat((seq, step_onehot), -1))
      feature = feature[
          torch.arange(len(feature), device=feature.device),
          obs["cur_step"].long(),
      ]
      return self.fc(feature)
  
imports: from __future__ import annotations
  from copy import deepcopy
  from typing import Tuple, Callable
  import gym
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from typing_extensions import TypedDict
  from gym import spaces
  from tianshou.data import ReplayBuffer, Batch, to_torch, to_numpy
  from tianshou.policy import BasePolicy, PPOPolicy
  from nni.mutable import Categorical, CategoricalMultiple, Mutable, MutableAnnotation, Sample
label_desc: Use image node_id 2 for calling the Preprocessor obj's underlying member method code with example usage: obj.forward(obs) and returns: self