Skip to content

Commit

Permalink
Generate just one seed, rather than generating two seeds and then tak…
Browse files Browse the repository at this point in the history
…ing the first half of each seed.

rng.make_seeds(n) generates a tensor with shape (2,n): each seed is a 2-tuple. The previous code took the first half of each of two seed tuples. Instead, we generate just one 2-tuple.

PiperOrigin-RevId: 606866194
  • Loading branch information
tensorflower-gardener authored and copybara-github committed Feb 14, 2024
1 parent e58176a commit 8b36191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/en/tutorials/images/data_augmentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@
"source": [
"# Create a wrapper function for updating seeds.\n",
"def f(x, y):\n",
" seed = rng.make_seeds(2)[0]\n",
" seed = rng.make_seeds(1)[:, 0]\n",
" image, label = augment((x, y), seed)\n",
" return image, label"
]
Expand Down

0 comments on commit 8b36191

Please sign in to comment.