Skip to content

Add public register_call_context_args method to Layer #21543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions keras/src/layers/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,22 @@ def call(self, x):
)


def register_call_context_args(self, *names):
"""Public wrapper for `_register_call_context_args`.

This method registers call-context arguments for this layer. It simply
forwards the provided argument names to the private method
`_register_call_context_args`. See `_register_call_context_args` for
details.

Args:
*names: Names of call-context arguments to register.

Returns:
None
"""
return self._register_call_context_args(*names)

def is_backend_tensor_or_symbolic(x, allow_none=False):
if allow_none and x is None:
return True
Expand Down
Loading