Skip to content

Commit

Permalink
Small update to tf.function guide
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitmp3 authored Sep 5, 2023
1 parent b3f4ce0 commit 53a1071
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/en/guide/function.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
"source": [
"#### Use unknown dimensions for flexibility\n",
"\n",
" Since TensorFlow matches tensors based on their shape, using a `None` dimension as a wildcard will allow `Function`s to reuse traces for variably-sized input. Variably-sized input can occur if you have sequences of different length, or images of different sizes for each batch (See the [Transformer](https://www.tensorflow.org/text/tutorials/transformer) and [Deep Dream](../tutorials/generative/deepdream.ipynb) tutorials for example)."
" Since TensorFlow matches tensors based on their shape, using a `None` dimension as a wildcard will allow `Function`s to reuse traces for variably-sized input. Variably-sized input can occur if you have sequences of different length, or images of different sizes for each batch. You can check out the [Transformer](https://www.tensorflow.org/text/tutorials/transformer) and [Deep Dream](../tutorials/generative/deepdream.ipynb) tutorials for examples."
]
},
{
Expand Down Expand Up @@ -974,7 +974,7 @@
"source": [
"When wrapping Python/NumPy data in a Dataset, be mindful of `tf.data.Dataset.from_generator` versus ` tf.data.Dataset.from_tensor_slices`. The former will keep the data in Python and fetch it via `tf.py_function` which can have performance implications, whereas the latter will bundle a copy of the data as one large `tf.constant()` node in the graph, which can have memory implications.\n",
"\n",
"Reading data from files via `TFRecordDataset`, `CsvDataset`, etc. is the most effective way to consume data, as then TensorFlow itself can manage the asynchronous loading and prefetching of data, without having to involve Python. To learn more, see the [`tf.data`: Build TensorFlow input pipelines](https://www.tensorflow.org/guide/data) guide."
"Reading data from files via `TFRecordDataset`, `CsvDataset`, etc. is the most effective way to consume data, as then TensorFlow itself can manage the asynchronous loading and prefetching of data, without having to involve Python. To learn more, see the [`tf.data`: Build TensorFlow input pipelines](data.ipynb) guide."
]
},
{
Expand Down

0 comments on commit 53a1071

Please sign in to comment.