class_docstr: Base class for all models.
class_docstr_tok: ["Base","class","for","all","models","."]
docstr: Reset the losses dict on each call.
  
  Args:
    *args: Arguments passed on to call().
    return_losses: Return a dictionary of losses in addition to the call()
      function returns.
    **kwargs: Keyword arguments passed on to call().
  
  Returns:
    outputs: A dictionary of model outputs generated in call().
      {output_name: output_tensor or dict}.
    losses: If return_losses=True, also returns a dictionary of losses,
      {loss_name: loss_value}.
docstr_tok: ["Reset","the","losses","dict","on","each","call",".","Args",":","*","args",":","Arguments","passed","on","to","call","(",")",".","return_losses",":","Return","a","dictionary","of","losses","in","addition","to","the","call","(",")","function","returns",".","*","*","kwargs",":","Keyword","arguments","passed","on","to","call","(",")",".","Returns",":","outputs",":","A","dictionary","of","model","outputs","generated","in","call","(",")",".","{","output_name",":","output_tensor","or","dict","}",".","losses",":","If","return_losses=True",",","also","returns","a","dictionary","of","losses",",","{","loss_name",":","loss_value","}","."]
code: def __call__(self, *args, return_losses=False, **kwargs):
      """Reset the losses dict on each call.
  
      Args:
        *args: Arguments passed on to call().
        return_losses: Return a dictionary of losses in addition to the call()
          function returns.
        **kwargs: Keyword arguments passed on to call().
  
      Returns:
        outputs: A dictionary of model outputs generated in call().
          {output_name: output_tensor or dict}.
        losses: If return_losses=True, also returns a dictionary of losses,
          {loss_name: loss_value}.
      """
      # Copy mutable dicts if in graph mode to prevent side-effects (pure func).
      args = [
          copy_if_tf_function(a) if isinstance(a, dict) else a
          for a in args
      ]
  
      # Run model.
      self._losses_dict = {}
      outputs = super().__call__(*args, **kwargs)
  
      # Get total loss.
      if not return_losses:
          return outputs
      else:
          self._losses_dict["total_loss"] = self.sum_losses(
              self._losses_dict
          )
          return outputs, self._losses_dict
  
file_path: ddsp/ddsp/training/models/model.py
imports: import time
  from absl import logging
  import ddsp
  from ddsp.core import copy_if_tf_function
  from ddsp.training import train_util
  import tensorflow
label_desc: Use image node_id 2 for calling the Model obj's underlying member method code with example usage: obj.__call__() and returns: outputs, outputs,  self