docstr: Given loss and optimizer name, get definitions and run test.
docstr_tok: ["Given","loss","and","optimizer","name",",","get","definitions","and","run","test","."]
code: def _test_loss_opt(
      self, loss_name: str, opt_name: str, override: bool = False
  ):
      """Given loss and optimizer name, get definitions and run test."""
      model_vars, loss = self._get_loss(loss_name)
      gv = objax.GradValues(loss, model_vars)
      opt = self._get_optimizer(model_vars, opt_name)
      test_name = "{}_{}".format(loss_name, opt_name)
      test_name = test_name + "_override" if override else test_name
      lr = self.lrs[test_name]
      tolerance = self.tolerances[test_name]
      options = (
          self.override_options[test_name]
          if override and test_name in self.override_options
          else None
      )
      self._check_run(
          gv, opt, loss, lr, self.num_steps, tolerance, options
      )
      return model_vars, loss
  
imports: import math
  import unittest
  import jax.numpy
  import numpy
  import objax
  from objax.variable import TrainVar, VarCollection
label_desc: Use image node_id 5 for calling the TestOptimizers obj's underlying member method code with example usage: obj._test_loss_opt(loss_name, opt_name, override) and returns: model_vars,  loss