docstr: Forward propages through the network. If any params are passed then they are used instead of stored params.
  
  Args:
      x: Input
      params: If params are None then internal parameters are used. If params are a dictionary with keys the
      same as the layer names then they will be used instead.
docstr_tok: ["Forward","propages","through","the","network",".","If","any","params","are","passed","then","they","are","used","instead","of","stored","params",".","Args",":","x",":","Input","params",":","If","params","are","None","then","internal","parameters","are","used",".","If","params","are","a","dictionary","with","keys","the","same","as","the","layer","names","then","they","will","be","used","instead","."]
code: def forward(self, x, params=None):
      """
      Forward propages through the network. If any params are passed then they are used instead of stored params.
  
      Args:
          x: Input
          params: If params are None then internal parameters are used. If params are a dictionary with keys the
          same as the layer names then they will be used instead.
  
      """
  
      if params is None:
          params = self.params
  
      assert len(params) // 2 == self.num_layers
  
      for i in range(self.num_layers):
          x = F.linear(x, params[i * 2], params[i * 2 + 1])
  
          # pass to an activation function if it's not the last layer
          if i != len(self.network_dims) - 2:
              x = F.relu(x)
  
      return x
  
file_path: PARL/benchmark/torch/maml++/maml_model.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import parl
label_desc: Use image node_id 2 for calling the MAMLModel obj's underlying member method code with example usage: obj.forward(x, params) and returns: x