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

View source on GitHub

A transformation that prefetches dataset values to the given device. (deprecated)

NOTE: Although the transformation creates a, the transformation must be the final Dataset in the input pipeline.


  • device: A string. The name of a device to which elements will be prefetched.
  • buffer_size: (Optional.) The number of elements to buffer on device. Defaults to an automatically chosen value.


A Dataset transformation function, which can be passed to