class_docstr: Tests of input_fn, doing end-to-end I/O.
  
  These tests instantiate an input stream and then check it in various ways,
  in increasing complexity.
class_docstr_tok: ["Tests","of","input_fn",",","doing","end-to-end","I\/O",".","These","tests","instantiate","an","input","stream","and","then","check","it","in","various","ways",",","in","increasing","complexity","."]
code: def check_batch_feed(
      self, batch_feed, use_tpu, expected_batch_size, expected_n_batches
  ):
      # Consume batch_feed, check that the right number of things is seen.
      with tf.compat.v1.Session() as sess:
          sess.run(tf.compat.v1.local_variables_initializer())
          sess.run(tf.compat.v1.global_variables_initializer())
  
          n = 0
          n_valid_entries = 0
          while True:
              try:
                  features = sess.run(batch_feed)
              except tf.errors.OutOfRangeError:
                  break
              n += 1
              a = features["image"]  # np.ndarray
              self.assertIsNot(a, None)
              if use_tpu:
                  self.assertEqual(a.dtype, np.dtype("int32"))
              else:
                  self.assertEqual(a.dtype, np.dtype("uint8"))
              current_batch_size = a.shape[0]
              self.assertLessEqual(
                  current_batch_size, expected_batch_size
              )
              self.assertEqual(
                  list(a.shape),
                  [current_batch_size]
                  + dv_constants.PILEUP_DEFAULT_DIMS,
              )
              n_valid_entries += current_batch_size
  
          self.assertEqual(expected_n_batches, n)
          self.assertEqual(
              testdata.N_GOLDEN_CALLING_EXAMPLES, n_valid_entries
          )
  
imports: import math
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow import estimator
  from deepvariant import data_providers
  from deepvariant import dv_config
  from deepvariant import dv_constants
  from deepvariant import dv_utils
  from deepvariant import testdata
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import variant_utils
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 2 for calling the InputTest obj's underlying member method code with example usage: obj.check_batch_feed(batch_feed, use_tpu, expected_batch_size, expected_n_batches) without return types