code: def test_digital_net_sample_with_dtype(self):
      dim = 5
      num_results = 6
      num_digits = 3  # ceil(log2(num_results))
  
      generating_matrices = qmc.sobol_generating_matrices(
          dim, num_results, num_digits
      )
  
      for dtype in [tf.float32, tf.float64]:
          expected = tf.constant(
              [
                  [0.000, 0.000, 0.000, 0.000, 0.000],
                  [0.500, 0.500, 0.500, 0.500, 0.500],
                  [0.250, 0.750, 0.750, 0.750, 0.250],
                  [0.750, 0.250, 0.250, 0.250, 0.750],
                  [0.125, 0.625, 0.375, 0.125, 0.125],
                  [0.625, 0.125, 0.875, 0.625, 0.625],
              ],
              dtype=dtype,
          )
  
          actual = qmc.digital_net_sample(
              generating_matrices,
              num_results,
              num_digits,
              validate_args=True,
              dtype=dtype,
          )
  
          with self.subTest("Values"):
              self.assertAllClose(
                  self.evaluate(actual),
                  self.evaluate(expected),
                  rtol=1e-6,
              )
          with self.subTest("DType"):
              self.assertEqual(actual.dtype, expected.dtype)
  
file_path: tf-quant-finance/tf_quant_finance/math/qmc/digital_net_test.py
imports: import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 8 for calling the DigitalNetTest obj's underlying member method code with example usage: obj.test_digital_net_sample_with_dtype() without return types