Skip to content
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

[RFC] Remove the need for super().__init__() call in BaseNode subclasses to better support dataclasses #1411

Open
andrewkho opened this issue Dec 18, 2024 · 0 comments
Labels

Comments

@andrewkho
Copy link
Contributor

🚀 The feature

Stop requiring BaseNode implementations to call super().init()

Motivation, pitch

Currently we require users to call super().init() but this can't be done easily with dataclasses, except in post_init. See eg nn.Module:

image

Alternatives

We could just leave it as-is, since DataClasses have a viable workaround with __post_init__. Right now we're only setting up a flag but it may be useful for other things in the future, such as registration with a global thread executor. Alternatively we could use a Loader wrapper class to register with an executor.

Additional context

No response

@andrewkho andrewkho changed the title [Nodes] Remove the need for super().__init__() call to better support dataclasses [RFC] Remove the need for super().__init__() call in BaseNode subclasses to better support dataclasses Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant