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

Commit 1e5e7b4

Browse files
afrozenatorcopybara-github
authored andcommitted
Move the tf.autograph.to_graph annotation just before using the _scan_step_fn.
Intended to fix this - https://travis-ci.org/tensorflow/tensor2tensor/jobs/587720856 I can't figure out why this became a problem suddenly. PiperOrigin-RevId: 272570396
1 parent a2fff1c commit 1e5e7b4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tensor2tensor/data_generators/generator_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ def _scanning_pack(self, dataset):
969969

970970
initial_state = self._scan_initial_state()
971971
step_fn = functools.partial(
972-
_scan_step_fn, packed_length=self._packed_length,
972+
tf.autograph.to_graph(_scan_step_fn), packed_length=self._packed_length,
973973
queue_size=self._queue_size, spacing=self._spacing,
974974
num_sequences=self._num_sequences, token_dtype=self._token_dtype)
975975

@@ -1020,7 +1020,6 @@ def _finalize(self, _, contents):
10201020
"segment": segment, "position": position}
10211021

10221022

1023-
@tf.autograph.to_graph
10241023
def _scan_step_fn(state, example, packed_length, queue_size, spacing,
10251024
num_sequences, token_dtype): # pylint: disable=g-doc-args
10261025
"""Transform function used by tf.data.experimental.scan to process an example.

0 commit comments

Comments
 (0)