class_docstr: This is a base class used to create Pytorch operator benchmark.
  module_name is the name of the operator being benchmarked.
  test_name is the name (it's created by concatenating all the
  inputs) of a specific test
docstr: This is used to automatically set the require_grad for the backward patch.
  It is implemented based on two counters. One counter to save the number of
  times init has been called. The other counter to save the number of times
  this function itself has been called. In the very first time init is called,
  this function counts how many inputs require gradient. In each of the
  following init calls, this function will return only one true value.
  Here is an example:
      ...
      self.v1 = torch.rand(M, N, K, requires_grad=self.auto_set())
      self.v2 = torch.rand(M, N, K, requires_grad=self.auto_set())
      ...
docstr_tok: ["This","is","used","to","automatically","set","the","require_grad","for","the","backward","patch",".","It","is","implemented","based","on","two","counters",".","One","counter","to","save","the","number","of","times","init","has","been","called",".","The","other","counter","to","save","the","number","of","times","this","function","itself","has","been","called",".","In","the","very","first","time","init","is","called",",","this","function","counts","how","many","inputs","require","gradient",".","In","each","of","the","following","init","calls",",","this","function","will","return","only","one","true","value",".","Here","is","an","example",":","...","self.v1","=","torch.rand","(","M",",","N",",","K",",","requires_grad=self.auto_set","(",")",")","self.v2","=","torch.rand","(","M",",","N",",","K",",","requires_grad=self.auto_set","(",")",")","..."]
code: def auto_set(self):
      """This is used to automatically set the require_grad for the backward patch.
      It is implemented based on two counters. One counter to save the number of
      times init has been called. The other counter to save the number of times
      this function itself has been called. In the very first time init is called,
      this function counts how many inputs require gradient. In each of the
      following init calls, this function will return only one true value.
      Here is an example:
          ...
          self.v1 = torch.rand(M, N, K, requires_grad=self.auto_set())
          self.v2 = torch.rand(M, N, K, requires_grad=self.auto_set())
          ...
      """
      if not self._is_backward:
          return False
  
      if self._pass_count == 0:
          self._num_inputs_require_grads += 1
          return True
      else:
          self._auto_set_counter += 1
          return self._pass_count == self._auto_set_counter
  
imports: import json
  import time
  import benchmark_cpp_extension
  import torch
label_desc: Use image node_id 3 for calling the TorchBenchmarkBase obj's underlying member method code with example usage: obj.auto_set() and returns: False, True, unknown