Skip to content

Commit a457480

Browse files
committed
Prevent lack of ragged_ops.py being released in TF from breaking tf.Text
PiperOrigin-RevId: 301226903
1 parent b74ad41 commit a457480

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tensorflow_text/python/ops/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
"""Various TensorFlow ops related to text-processing."""
1717

18-
from tensorflow.python.ops.ragged import ragged_ops as _ragged_ops
18+
# pylint: disable=g-import-not-at-top,g-statement-before-imports
19+
try:
20+
from tensorflow.python.ops.ragged import ragged_ops as _ragged_ops
21+
except ImportError:
22+
pass
1923
from tensorflow_text.python.ops.bert_tokenizer import BertTokenizer
2024
from tensorflow_text.python.ops.create_feature_bitmask_op import create_feature_bitmask
2125
from tensorflow_text.python.ops.greedy_constrained_sequence_op import greedy_constrained_sequence

0 commit comments

Comments
 (0)