code: def forward(self, inputs, states, masks):
      x = self.main(inputs / 255.0)
  
      if hasattr(self, "gru"):
          if inputs.size(0) == states.size(0):
              x = states = self.gru(x, states * masks)
          else:
              x = x.view(-1, states.size(0), x.size(1))
  
              masks = masks.view(-1, states.size(0), 1)
              outputs = []
  
              for i in range(x.size(0)):
                  hx = states = self.gru(x[i], states * masks[i])
                  outputs.append(hx)
  
              x = torch.cat(outputs, 0)
  
      return self.critic_linear(x), x, states
  
file_path: SerpentAI/serpent/machine_learning/reinforcement_learning/ppo/cnn_base.py
imports: import torch
label_desc: Use image node_id 4 for calling the CNNBase obj's underlying member method code with example usage: obj.forward(inputs, states, masks) and returns: self,  x,  states