Is there a way to "clear" registered layers?
See original GitHub issueSystem information
- TensorFlow.js version (you are using): 4.0.0
- Are you willing to contribute it (Yes/No): Yes
Describe the feature and the current behavior/state.
We can register a custom layer with tf.serialization.registerClass
.
As far as I can tell, there is no way to deregister a custom layer, or otherwise clear the backend of registered layers.
Will this change the current api? How? Unclear.
Who will benefit with this feature? This seems like a rather niche use case, but I’ll give my specific use case.
I have a model that requires custom layers, and these custom layers are instantiated with some specific parameters.
I unit test a number of model instances in Node.
If I try to test, say, three different model instances with foo
, bar
, and baz
parameters passed to a custom layer, the layer with baz
overwrites the rest (as it is instantiated last).
It would be nice if a user could check if any layers have been globally registered, and if so, deregister those layers.
Any Other info.
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (2 by maintainers)
Top GitHub Comments
@thekevinscott You can propose the API change first in this thread, it should be more efficient.
@mattsoulanille @thekevinscott Thank you for the great discussion, I like the idea of a global registry + model level namespace. The loadOption sounds good to me, it should also apply to custom ops for GraphModel, which is also currently a global registry.