[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.data.experimental.prefetch_to_device\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/data/experimental/prefetch_to_device) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/data/experimental/ops/prefetching_ops.py#L36-L56) |\n\nA transformation that prefetches dataset values to the given `device`.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.data.experimental.prefetch_to_device`](/api_docs/python/tf/data/experimental/prefetch_to_device), \\`tf.compat.v2.data.experimental.prefetch_to_device\\`\n\n\u003cbr /\u003e\n\n tf.data.experimental.prefetch_to_device(\n device, buffer_size=None\n )\n\n| **Note:** Although the transformation creates a [`tf.data.Dataset`](../../../tf/data/Dataset), the transformation must be the final `Dataset` in the input pipeline.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------|------------------------------------------------------------------------------------------------------|\n| `device` | A string. The name of a device to which elements will be prefetched. |\n| `buffer_size` | (Optional.) The number of elements to buffer on `device`. Defaults to an automatically chosen value. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Dataset` transformation function, which can be passed to [`tf.data.Dataset.apply`](../../../tf/data/Dataset#apply). ||\n\n\u003cbr /\u003e"]]