Skip to content

Commit

Permalink
Use tf.logging instead of absl.logging for consistency.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 684150815
  • Loading branch information
lingvo-bot authored and copybara-github committed Oct 9, 2024
1 parent 1740b35 commit ec885ef
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lingvo/core/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import math
from typing import Optional, Tuple

from absl import logging
import lingvo.compat as tf
from lingvo.core import base_layer
from lingvo.core import gshard_utils
Expand Down Expand Up @@ -550,11 +549,11 @@ def AttenProbs(inputs: py_utils.NestedMap) -> tf.Tensor:
)
else:
if hasattr(inputs, 'source_segment_id'):
logging.warning(
tf.logging.warning(
'packed_input is False but source_segment_id is passed.'
)
if hasattr(inputs, 'query_segment_id'):
logging.warning(
tf.logging.warning(
'packed_input is False but query_segment_id is passed.'
)
# Reshape logits to a matrix of shape [target_batch, source_length] and
Expand Down Expand Up @@ -715,11 +714,11 @@ def AttenProbs(inputs: py_utils.NestedMap) -> tf.Tensor:
source_padding = tf.squeeze(source_padding, 1)
else:
if hasattr(inputs, 'source_segment_id'):
logging.warning(
tf.logging.warning(
'packed_input is False but source_segment_id is passed.'
)
if hasattr(inputs, 'query_segment_id'):
logging.warning(
tf.logging.warning(
'packed_input is False but query_segment_id is passed.'
)
# [b, sl]
Expand Down Expand Up @@ -1067,11 +1066,11 @@ def AttenProbs(
source_padding = tf.transpose(source_padding, [1, 2, 0])
else:
if hasattr(inputs, 'source_segment_id'):
logging.warning(
tf.logging.warning(
'packed_input is False but source_segment_id is passed.'
)
if hasattr(inputs, 'query_segment_id'):
logging.warning(
tf.logging.warning(
'packed_input is False but query_segment_id is passed.'
)
source_padding = tf.transpose(source_padding, [2, 0, 1])
Expand Down

0 comments on commit ec885ef

Please sign in to comment.