File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 19
19
20
20
import tensorflow as tf , tf_keras
21
21
22
+ # pylint: disable=g-direct-tensorflow-import
23
+ from tensorflow .python .tpu .google .sparse_core import tpu_embedding_v3
24
+ # pylint: enable=g-direct-tensorflow-import
25
+
22
26
23
27
def create_loop_fn (step_fn ):
24
28
"""Creates a loop function driven by a Python `while` loop.
@@ -200,7 +204,8 @@ class LoopFnWithSummaries(tpu_summaries.OptionalSummariesFunction):
200
204
201
205
def __call__ (self , iterator , num_steps ):
202
206
if tf .summary .should_record_summaries ():
203
- output = self .with_summaries (iterator , tf .constant (1 ))
207
+ with tpu_embedding_v3 .SequentialEmbeddingContext ():
208
+ output = self .with_summaries (iterator , tf .constant (1 ))
204
209
num_steps -= 1
205
210
if num_steps >= 1 :
206
211
output = self .without_summaries (iterator , num_steps )
You can’t perform that action at this time.
0 commit comments