TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now


TensorFlow 1 version View source on GitHub

Class RepresentativeDataset

Representative dataset to evaluate optimizations.


  • Class tf.compat.v1.lite.RepresentativeDataset
  • Class tf.compat.v2.lite.RepresentativeDataset

A representative dataset that can be used to evaluate optimizations by the converter. E.g. converter can use these examples to estimate (min, max) ranges by calibrating the model on inputs. This can allow converter to quantize a converted floating point model.


View source


Creates a representative dataset.


  • input_gen: an input generator that can be used to generate input samples for the model. This must be a callable object that returns an object that supports the iter() protocol (e.g. a generator function). The elements generated must have same type and shape as inputs to the model.