You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add use_causal_mask to MultiHeadAttention and approximate GELU
The MultiHeadAttention layer now respects the per-call use_causal_mask=True
kwarg: scores at (t, k) for k > t are set to -inf before softmax. The
converter extracts the flag from the layer's first inbound node and bakes it
into the JSON config so the runtime can pick it up.
GELU gains the tanh-approximation form. A serializable gelu_approximate
helper in convert_model lets Keras models reference it via
activation=gelu_approximate; the converter rewrites that to a plain "gelu"
activation with approximate=True in the config, which the C++ gelu_layer
applies via the appropriate formula.
Both features are exercised by new cases in the exhaustive test model.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments