docstr: Checks handling batches and dtypes.
docstr_tok: ["Checks","handling","batches","and","dtypes","."]
code: def _test_batches_and_types(self, integrate_function, args):
      """Checks handling batches and dtypes."""
      dtypes = [np.float32, np.float64, np.complex64, np.complex128]
      a = [[0.0, 0.0], [0.0, 0.0]]
      b = [[np.pi / 2, np.pi], [1.5 * np.pi, 2 * np.pi]]
      a = [a, a]
      b = [b, b]
      k = tf.constant([[[[1.0]]], [[[2.0]]]])
      func = lambda x: tf.cast(k, dtype=x.dtype) * tf.sin(x)
      ans = [[[1.0, 2.0], [1.0, 0.0]], [[2.0, 4.0], [2.0, 0.0]]]
  
      results = []
      for dtype in dtypes:
          lower = tf.constant(a, dtype=dtype)
          upper = tf.constant(b, dtype=dtype)
          results.append(integrate_function(func, lower, upper, **args))
  
      results = self.evaluate(results)
  
      for i in range(len(results)):
          assert results[i].dtype == dtypes[i]
          assert np.allclose(results[i], ans, atol=1e-3)
  
imports: import collections
  import math
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.math.integration import adaptive_update
label_desc: Use image node_id 1 for calling the IntegrationTest obj's underlying member method code with example usage: obj._test_batches_and_types(integrate_function, args) without return types