code: def testBaseCase(self):
      # Example taken from:
      # https://en.wikipedia.org/wiki/Quantile_regression
      # Random variable takes values 1...9 with equal probability.
      y_true = tf.constant(np.arange(1, 10), dtype=tf.float32)
  
      # Compute the loss for the median.
      # We see that the value `y_pred = 5` minimizes the loss.
  
      p_loss = loss_utils.pinball_loss(
          y_true, y_pred=3 * tf.ones_like(y_true), quantile=0.5
      )
      self.assertNear(24.0, 9.0 / 0.5 * self.evaluate(p_loss), err=1e-3)
  
      p_loss = loss_utils.pinball_loss(
          y_true, y_pred=4 * tf.ones_like(y_true), quantile=0.5
      )
      self.assertNear(21.0, 9.0 / 0.5 * self.evaluate(p_loss), err=1e-3)
  
      p_loss = loss_utils.pinball_loss(
          y_true, y_pred=5 * tf.ones_like(y_true), quantile=0.5
      )
      self.assertNear(20.0, 9.0 / 0.5 * self.evaluate(p_loss), err=1e-3)
  
      p_loss = loss_utils.pinball_loss(
          y_true, y_pred=6 * tf.ones_like(y_true), quantile=0.5
      )
      self.assertNear(21.0, 9.0 / 0.5 * self.evaluate(p_loss), err=1e-3)
  
      p_loss = loss_utils.pinball_loss(
          y_true, y_pred=7 * tf.ones_like(y_true), quantile=0.5
      )
      self.assertNear(24.0, 9.0 / 0.5 * self.evaluate(p_loss), err=1e-3)
  
file_path: agents/tf_agents/bandits/policies/loss_utils_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from tf_agents.bandits.policies import loss_utils
label_desc: Use image node_id 1 for calling the LossUtilsTest obj's underlying member method code with example usage: obj.testBaseCase() without return types