docstr: Applies an inner loop update
  
  Args:
      loss: Loss on support set
      weights: Network weights
      use_second_order: If use second order
      current_update_step
  
  Returns:
      updated network weights
docstr_tok: ["Applies","an","inner","loop","update","Args",":","loss",":","Loss","on","support","set","weights",":","Network","weights","use_second_order",":","If","use","second","order","current_update_step","Returns",":","updated","network","weights"]
code: def _inner_loop_update(
      self, loss, weights, use_second_order, current_update_step
  ):
      """Applies an inner loop update
  
      Args:
          loss: Loss on support set
          weights: Network weights
          use_second_order: If use second order
          current_update_step
  
      Returns:
          updated network weights
  
      """
      self.model.zero_grad(weights)
  
      grads = torch.autograd.grad(
          loss,
          weights,
          create_graph=use_second_order,
          allow_unused=True,
      )
  
      updated_weights = list()
  
      for idx, (weight, grad) in enumerate(zip(weights, grads)):
          updated_weight = (
              weight
              - self.learning_rates[current_update_step, idx // 2]
              * grad
          )
          updated_weights.append(updated_weight)
  
      return updated_weights
  
file_path: PARL/benchmark/torch/maml++/maml_algorithm.py
imports: import torch
  from torch import nn
  from torch import optim
  import torch.nn.functional
  import numpy
  import parl
label_desc: Use image node_id 4 for calling the MAML obj's underlying member method code with example usage: obj._inner_loop_update(loss, weights, use_second_order, current_update_step) and returns: updated_weights