code: def testVarianceAllowNanStatsFalseRaisesForUndefinedBatchMembers(
      self,
  ):
      # df <= 1 ==> variance not defined
      half_student = half_student_t.HalfStudentT(
          df=1.0,
          loc=0.0,
          scale=1.0,
          allow_nan_stats=False,
          validate_args=True,
      )
      with self.assertRaisesOpError("x < y"):
          self.evaluate(half_student.variance())
  
      # df <= 1 ==> variance not defined
      half_student = half_student_t.HalfStudentT(
          df=0.5,
          loc=0.0,
          scale=1.0,
          allow_nan_stats=False,
          validate_args=True,
      )
      with self.assertRaisesOpError("x < y"):
          self.evaluate(half_student.variance())
  
imports: import math
  import numpy
  from scipy import stats
  from scipy.special import gamma
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import half_student_t
  from tensorflow_probability.python.distributions.internal import statistical_testing
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 17 for calling the HalfStudentTTest obj's underlying member method code with example usage: obj.testVarianceAllowNanStatsFalseRaisesForUndefinedBatchMembers() without return types