question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to "clear" registered layers?

See original GitHub issue

System 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:open
  • Created 10 months ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pyu10055commented, Nov 30, 2022

@thekevinscott You can propose the API change first in this thread, it should be more efficient.

0reactions
pyu10055commented, Dec 2, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Delete un-used layers from database. - AutoCAD DevBlog
Database. Purge API can be used to identify the un-used layers. Once un-used layer are identified, you can use “erase” API to remove...
Read more >
Completely removing SDE layers via the command line
So my question is, is there a simple way to completely and safely remove all of the underlying layer metadata from the command...
Read more >
Clearing the contents of layers - Corel Painter Help
Pressing Command + A (macOS) or Ctrl + A (Windows ), and then pressing Delete doesn't clear all layer contents, just what is...
Read more >
How to remove all selection from all registered layers using ...
There is probably a better way to do this, but you can iterate the layers in mapCanvas, and use removeSelection() method.
Read more >
Overwrite a web feature layer—ArcGIS Pro | Documentation
Overwrite existing web feature layers to reflect changes to a GIS resource ... The fields may be empty if you chose to use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found