class_docstr: N-A2C Tuner
  Based on paper Compiler-Level Matrix Multiplication Optimization for Deep Learning
  
  Parameters
  ----------
  optimize_mode: str, 'maximize' or 'minimize'
  n_states: int,
      The maximum search steps Tau
  n_steps: int
      number of steps to train the policy and critic networks each iteration
  hidden_size: int,
      number of hidden size of the policy and critic networks
  lr: float,
      learning rate of the policy and critic networks
class_docstr_tok: ["N-A2C","Tuner","Based","on","paper","Compiler-Level","Matrix","Multiplication","Optimization","for","Deep","Learning","Parameters","--","--","--","--","--","optimize_mode",":","str",",","'maximize","'","or","'minimize'","n_states",":","int",",","The","maximum","search","steps","Tau","n_steps",":","int","number","of","steps","to","train","the","policy","and","critic","networks","each","iteration","hidden_size",":","int",",","number","of","hidden","size","of","the","policy","and","critic","networks","lr",":","float",",","learning","rate","of","the","policy","and","critic","networks"]
docstr: Method invoked when a trial is completed or terminated.
  
  Override of the abstract method in :class:`~nni.tuner.Tuner`.
docstr_tok: ["Method","invoked","when","a","trial","is","completed","or","terminated",".","Override","of","the","abstract","method","in",":","class",":","`","~nni.tuner.Tuner","`","."]
code: def trial_end(self, parameter_id, success, **kwargs):
      """Method invoked when a trial is completed or terminated.
  
      Override of the abstract method in :class:`~nni.tuner.Tuner`.
      """
      if not success:
          self.population.append(self.wait_dict[parameter_id], 0.0)
          del self.wait_dict[parameter_id]
  
          if not self.serve_list and not self.wait_dict:
              self.serve_list = self.population.generate()
              if not self.serve_list:
                  raise RuntimeError(
                      "Tuner stopped since no candidates"
                  )
  
          while self.request_list and self.serve_list:
              param_id = self.request_list[0]
              self.wait_dict[param_id] = self.serve_list.pop()
              self.send_trial_callback(
                  param_id, self.wait_dict[param_id].pick_out()
              )
              self.request_list.pop(0)
  
imports: import math
  import random
  import logging
  import copy
  import torch
  from torch import optim
  from torch import nn
  import torch.nn.functional
  import numpy
  import nni
  from nni.tuner import Tuner
label_desc: Use image node_id 6 for calling the N_A2C obj's underlying member method code with example usage: obj.trial_end(parameter_id, success) without return types