Update index_lookup.py
Included tf.executing_eagerly() as requested.Thank you!
@@ -349,6 +349,9 @@ class IndexLookup(base_preprocessing_layer.PreprocessingLayer):
Returns:
The integer size of the voculary, including optional mask and oov indices.
"""
+ if tf.executing_eagerly():
+ return int(self.lookup_table.size().numpy()) + self._token_start_index()
+ else:
return self.lookup_table.size() + self._token_start_index()
def vocab_size(self):
