Summary
keras.layers.IntegerLookup correctly errors in eager mode when num_oov_indices=0 and the input contains values outside the vocabulary. This reproduction does not appear to show a bug; it matches the documented behavior.
Reproduction
import keras
import numpy as np
layer = keras.layers.IntegerLookup(
vocabulary=list(range(100)),
num_oov_indices=0,
mask_token=-1,
)
x = np.array([[12, 1138, 42], [42, 1000, 36]])
layer(x)
Expected result
An error indicating that inputs must all be in-vocabulary when num_oov_indices=0.
Actual result
An exception is raised:
When num_oov_indices=0 all inputs should be in vocabulary, found OOV values [1138 1000]
Notes
The symbolic keras.Input(...) path still builds and returns output shape (None, 3) as expected.
Summary
keras.layers.IntegerLookupcorrectly errors in eager mode whennum_oov_indices=0and the input contains values outside the vocabulary. This reproduction does not appear to show a bug; it matches the documented behavior.Reproduction
Expected result
An error indicating that inputs must all be in-vocabulary when
num_oov_indices=0.Actual result
An exception is raised:
When num_oov_indices=0 all inputs should be in vocabulary, found OOV values [1138 1000]Notes
The symbolic
keras.Input(...)path still builds and returns output shape(None, 3)as expected.