Skip to content

Commit

Permalink
Merge pull request #2287 from swap-10:tpu-guide-rename-deprecated-fn
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 671098426
  • Loading branch information
copybara-github committed Sep 4, 2024
2 parents 050f9ec + 48a1db2 commit f3b5dc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions site/en/guide/tpu.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
"source": [
"### Train the model using a custom training loop\n",
"\n",
"You can also create and train your model using `tf.function` and `tf.distribute` APIs directly. You can use the `Strategy.experimental_distribute_datasets_from_function` API to distribute the `tf.data.Dataset` given a dataset function. Note that in the example below the batch size passed into the `Dataset` is the per-replica batch size instead of the global batch size. To learn more, check out the [Custom training with `tf.distribute.Strategy`](../tutorials/distribute/custom_training.ipynb) tutorial.\n"
"You can also create and train your model using `tf.function` and `tf.distribute` APIs directly. You can use the `Strategy.distribute_datasets_from_function` API to distribute the `tf.data.Dataset` given a dataset function. Note that in the example below the batch size passed into the `Dataset` is the per-replica batch size instead of the global batch size. To learn more, check out the [Custom training with `tf.distribute.Strategy`](../tutorials/distribute/custom_training.ipynb) tutorial.\n"
]
},
{
Expand Down Expand Up @@ -449,7 +449,7 @@
"# on each TPU worker.\n",
"per_replica_batch_size = batch_size // strategy.num_replicas_in_sync\n",
"\n",
"train_dataset = strategy.experimental_distribute_datasets_from_function(\n",
"train_dataset = strategy.distribute_datasets_from_function(\n",
" lambda _: get_dataset(per_replica_batch_size, is_training=True))\n",
"\n",
"@tf.function\n",
Expand Down Expand Up @@ -600,4 +600,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit f3b5dc4

Please sign in to comment.