code: def test_regression_loss_fns(
      self,
      distillation_spec,
      teacher_logits,
      my_id,
      labels,
      logits,
      expected,
      weights=np.float32([2.0, 2.0, 2.0]),
  ):
      # Force graph mode
      with tf.compat.v1.Graph().as_default():
          loss_fn = distillation.get_distillation_loss_fn(
              teacher_logits, distillation_spec, my_id, _loss_fn
          )
  
          with self.test_session() as sess:
              actual_unweighted = sess.run(
                  loss_fn(labels=labels, logits=logits)
              )
              actual_weighted = sess.run(
                  loss_fn(labels=labels, logits=logits, weights=weights)
              )
          self.assertAllClose(actual_unweighted, expected)
          self.assertAllClose(actual_weighted, expected * 2)
  
file_path: model_search/model_search/meta/distillation_test.py
imports: from absl.testing import parameterized
  from model_search.meta import distillation
  from model_search.proto import distillation_spec_pb2
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling the DistillationTest obj's underlying member method code with example usage: obj.test_regression_loss_fns(distillation_spec, teacher_logits, my_id, labels, logits, expected, weights) without return types