keras/src/layers/preprocessing/index_lookup.py/IndexLookup/_record_vocabulary_size
class IndexLookup:    def _record_vocabulary_size(self):
        self._ensure_vocab_size_unchanged()
        with tf.init_scope():
            self._frozen_vocab_size = self.vocabulary_size()