Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Replace deprecated tf.contrib.data.map_and_batch(...) with `tf.data…
Browse files Browse the repository at this point in the history
….experimental.map_and_batch(...)`.

PiperOrigin-RevId: 523833192
  • Loading branch information
albert-copybara committed Apr 12, 2023
1 parent 68286fb commit b772393
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions classifier_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from albert import tokenization
import tensorflow.compat.v1 as tf
from tensorflow.compat.v1 import estimator as tf_estimator
from tensorflow.contrib import data as contrib_data
from tensorflow.contrib import metrics as contrib_metrics
from tensorflow.contrib import tpu as contrib_tpu

Expand Down Expand Up @@ -739,7 +738,7 @@ def input_fn(params):
d = d.shuffle(buffer_size=100)

d = d.apply(
contrib_data.map_and_batch(
tf.data.experimental.map_and_batch(
lambda record: _decode_record(record, name_to_features),
batch_size=batch_size,
drop_remainder=drop_remainder))
Expand Down
3 changes: 1 addition & 2 deletions squad_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from six.moves import range
import tensorflow.compat.v1 as tf
from tensorflow.compat.v1 import estimator as tf_estimator
from tensorflow.contrib import data as contrib_data
from tensorflow.contrib import layers as contrib_layers
from tensorflow.contrib import tpu as contrib_tpu

Expand Down Expand Up @@ -696,7 +695,7 @@ def input_fn(params):
d = d.shuffle(buffer_size=100)

d = d.apply(
contrib_data.map_and_batch(
tf.data.experimental.map_and_batch(
lambda record: _decode_record(record, name_to_features),
batch_size=batch_size,
drop_remainder=drop_remainder))
Expand Down

0 comments on commit b772393

Please sign in to comment.