code: def test_bias_and_variance_with_non_const_discount_mask(
      self, advantage_fn
  ):
      non_const_discount_mask = np.array([[1, 0, 1, 0, 1]])
      const_discount_mask = np.ones_like(non_const_discount_mask)
      est_bias_and_variance = functools.partial(
          estimate_advantage_bias_and_variance,
          advantage_fn,
          length=const_discount_mask.shape[1],
          # Set gamma to a small value to accentuate the differences.
          gamma=0.5,
          # We want to measure error due to the discount, so compare with the
          # undiscounted return.
          discount_true_return=False,
          # Use true values to remove the value estimation error.
          true_value=True,
      )
      (bias_non_const, var_non_const) = est_bias_and_variance(
          discount_mask=non_const_discount_mask
      )
      (bias_const, var_const) = est_bias_and_variance(
          discount_mask=const_discount_mask
      )
      self.assertLess(bias_non_const, bias_const)
      self.assertGreater(var_non_const, var_const)
  
file_path: trax/trax/rl/advantages_test.py
imports: import functools
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from trax.rl import advantages
label_desc: Use image node_id 10 for calling the AdvantagesTest obj's underlying member method code with example usage: obj.test_bias_and_variance_with_non_const_discount_mask(advantage_fn) without return types