code: def test_regression_loss_fns(
      self, loss_fn_factory, labels, logits, expected
  ):
      # Force graph mode
      with tf.compat.v1.Graph().as_default():
          loss_fn = loss_fn_factory()
          with self.test_session() as sess:
              actual_unweighted = sess.run(loss_fn(labels, logits))
              weights = np.ones(len(labels)) * 2
              actual_weighted = sess.run(
                  loss_fn(labels, logits, weights)
              )
          self.assertAllClose(actual_unweighted, expected)
          self.assertAllClose(actual_weighted, expected * 2)
  
file_path: model_search/model_search/loss_fns_test.py
imports: from absl.testing import parameterized
  from model_search import loss_fns
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling the LossFnsTest obj's underlying member method code with example usage: obj.test_regression_loss_fns(loss_fn_factory, labels, logits, expected) without return types