class_docstr: Tests functions for representative datasets.
class_docstr_tok: ["Tests","functions","for","representative","datasets","."]
code: def test_get_num_samples_returns_none_for_generator(self):
      num_samples = 8
  
      def data_gen() -> repr_dataset.RepresentativeDataset:
          for _ in range(num_samples):
              yield {
                  "input_tensor": np.random.uniform(
                      low=-1.0, high=1.0, size=(1, 4)
                  )
              }
  
      repr_ds = data_gen()
      self.assertIsNone(repr_dataset.get_num_samples(repr_ds))
  
      # Make sure that the __next__() is never called during the
      # get_num_samples call.
      self.assertLen(list(repr_ds), num_samples)
  
imports: import random
  import numpy
  from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
  from tensorflow.python.types import core
label_desc: Use image node_id 10 for calling the RepresentativeDatasetTest obj's underlying member method code with example usage: obj.test_get_num_samples_returns_none_for_generator() without return types