Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 19f3a62

Browse files
author
Frank Chen
committed
Change fingerprint function to set_snapshot_fingerprint
1 parent 0b28765 commit 19f3a62

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rfcs/20200107-tf-data-snapshot.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,22 @@ dataset = dataset.map(preprocessing_fn)
168168
```
169169

170170
In the above example, our `features_to_multiply` variable uses a `set`, which is
171-
not guaranteed to be ordered in Python 2. When we iterate over the set in the
171+
not guaranteed to be ordered in Python. When we iterate over the set in the
172172
for loop within `preprocessing_fn`, we may get a different graph on each
173173
run (i.e. one run could have us multiplying `feature2` first, then `feature4`,
174174
etc..., while another run may have us multiplying `feature1`, then `feature3`,
175175
and so on).
176176

177177
In cases like these, we can ask fingerprinting to use a fixed value for the
178-
fingerprint of the map function with a new `set_fingerprint`
178+
fingerprint of the map function with a new `set_snapshot_fingerprint`
179179
transformation, which asks the fingerprinting function to not compute the
180180
fingerprint of the previous node but to use a user-specified value instead:
181181

182182
```python
183183
dataset = ...
184184
dataset = dataset.map(preprocessing_fn)
185-
dataset = tf.data.set_fingerprint(dataset, fingerprint="my_fixed_fp")
185+
dataset = tf.data.experimental.set_snapshot_fingerprint(
186+
dataset, fingerprint="my_fixed_fp")
186187
```
187188

188189
### External API Guarantees

0 commit comments

Comments
 (0)