docstr: Builds a multi-layer perceptron. It also provides functionality for passing external parameters to be
  used at inference time.
  
  Args:
      network_dims: List, define the dimension of each linear layer.
      device: Cpu or cuda.
docstr_tok: ["Builds","a","multi-layer","perceptron",".","It","also","provides","functionality","for","passing","external","parameters","to","be","used","at","inference","time",".","Args",":","network_dims",":","List",",","define","the","dimension","of","each","linear","layer",".","device",":","Cpu","or","cuda","."]
code: def __init__(self, network_dims, device):
      """
      Builds a multi-layer perceptron. It also provides functionality for passing external parameters to be
      used at inference time.
  
      Args:
          network_dims: List, define the dimension of each linear layer.
          device: Cpu or cuda.
      """
      super().__init__()
  
      self.network_dims = network_dims
      self.num_layers = len(network_dims) - 1
  
      self.params = list()
  
      for i in range(len(self.network_dims) - 1):
          weight = nn.Parameter(
              torch.zeros(
                  (self.network_dims[i + 1], self.network_dims[i]),
                  device=device,
              )
          )
          torch.nn.init.kaiming_normal_(weight)
          self.params.append(weight)
          self.params.append(
              nn.Parameter(
                  torch.zeros((self.network_dims[i + 1]), device=device)
              )
          )
  
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 1 to create a new MAMLModel object from inherited base classes: parl with example: obj = MAMLModel(network_dims, device)