class_docstr: Base class for various modules which compute derivatives.
class_docstr_tok: ["Base","class","for","various","modules","which","compute","derivatives","."]
docstr: Returns the computed gradients for the first value returned by `f` and optionally values returned by `f`.
docstr_tok: ["Returns","the","computed","gradients","for","the","first","value","returned","by","`","f","`","and","optionally","values","returned","by","`","f","`","."]
code: def __call__(self, *args, **kwargs):
      """Returns the computed gradients for the first value returned by `f` and optionally values returned by `f`."""
      inputs = [args[i] for i in self.input_argnums]
      g, aux_out = self._call(
          inputs + self.vc.subset(TrainVar).tensors(),
          self.vc.subset(BaseState).tensors(),
          list(args),
          kwargs,
      )
      if self.return_all_f_outputs:
          outputs, changes = aux_out
          self.vc.assign(changes)
          return g, outputs
      else:
          changes = aux_out
          self.vc.assign(changes)
          return g
  
imports: import inspect
  from typing import List, Optional, Callable, Tuple, Dict, Union
  import jax
  from objax.module import Function, Module
  from objax.typing import JaxArray
  from objax.util import repr_function, class_name
  from objax.variable import BaseState, TrainVar, VarCollection
label_desc: Use image node_id 2 for calling the _DerivativeBase obj's underlying member method code with example usage: obj.__call__() and returns: g,  outputs, g