class_docstr: Tests functions for representative datasets.
class_docstr_tok: ["Tests","functions","for","representative","datasets","."]
code: def test_replace_tensors_by_numpy_ndarrays_is_noop_when_no_tensor(
      self,
  ):
      # Fill the representative dataset with np.ndarrays only.
      repr_ds: repr_dataset.RepresentativeDataset = [
          {
              "input_tensor": np.random.uniform(
                  low=-1.0, high=1.0, size=(4, 3)
              ),
          }
          for _ in range(8)
      ]
  
      with self.session() as sess:
          new_repr_ds = repr_dataset.replace_tensors_by_numpy_ndarrays(
              repr_ds, sess
          )
  
          # The resulting dataset should not contain any tf.Tensors.
          self.assertFalse(any(map(_contains_tensor, new_repr_ds)))
          self._assert_sample_values_all_close(
              sess, repr_ds, new_repr_ds
          )
  
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 5 for calling the RepresentativeDatasetTest obj's underlying member method code with example usage: obj.test_replace_tensors_by_numpy_ndarrays_is_noop_when_no_tensor() without return types