mirror of
https://github.com/ROCm/jax.git
synced 2025-04-19 05:16:06 +00:00
Add runtime type check in named_scope to ensure that name is a string.
PiperOrigin-RevId: 470177071
This commit is contained in:
parent
0cbdf858c7
commit
3c9178745b
@ -3180,6 +3180,8 @@ def named_scope(
|
||||
... logits = w.dot(x)
|
||||
... return jax.nn.relu(logits)
|
||||
"""
|
||||
if not isinstance(name, str):
|
||||
raise ValueError("named_scope name argument must be a string.")
|
||||
with source_info_util.extend_name_stack(name):
|
||||
yield
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user