Skip to content

Commit ec885ef

Browse files
lingvo-botcopybara-github
authored andcommitted
Use tf.logging instead of absl.logging for consistency.
PiperOrigin-RevId: 684150815
1 parent 1740b35 commit ec885ef

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lingvo/core/attention.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import math
1818
from typing import Optional, Tuple
1919

20-
from absl import logging
2120
import lingvo.compat as tf
2221
from lingvo.core import base_layer
2322
from lingvo.core import gshard_utils
@@ -550,11 +549,11 @@ def AttenProbs(inputs: py_utils.NestedMap) -> tf.Tensor:
550549
)
551550
else:
552551
if hasattr(inputs, 'source_segment_id'):
553-
logging.warning(
552+
tf.logging.warning(
554553
'packed_input is False but source_segment_id is passed.'
555554
)
556555
if hasattr(inputs, 'query_segment_id'):
557-
logging.warning(
556+
tf.logging.warning(
558557
'packed_input is False but query_segment_id is passed.'
559558
)
560559
# Reshape logits to a matrix of shape [target_batch, source_length] and
@@ -715,11 +714,11 @@ def AttenProbs(inputs: py_utils.NestedMap) -> tf.Tensor:
715714
source_padding = tf.squeeze(source_padding, 1)
716715
else:
717716
if hasattr(inputs, 'source_segment_id'):
718-
logging.warning(
717+
tf.logging.warning(
719718
'packed_input is False but source_segment_id is passed.'
720719
)
721720
if hasattr(inputs, 'query_segment_id'):
722-
logging.warning(
721+
tf.logging.warning(
723722
'packed_input is False but query_segment_id is passed.'
724723
)
725724
# [b, sl]
@@ -1067,11 +1066,11 @@ def AttenProbs(
10671066
source_padding = tf.transpose(source_padding, [1, 2, 0])
10681067
else:
10691068
if hasattr(inputs, 'source_segment_id'):
1070-
logging.warning(
1069+
tf.logging.warning(
10711070
'packed_input is False but source_segment_id is passed.'
10721071
)
10731072
if hasattr(inputs, 'query_segment_id'):
1074-
logging.warning(
1073+
tf.logging.warning(
10751074
'packed_input is False but query_segment_id is passed.'
10761075
)
10771076
source_padding = tf.transpose(source_padding, [2, 0, 1])

0 commit comments

Comments
 (0)