-
Notifications
You must be signed in to change notification settings - Fork 213
add_module API #906
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
add_module API #906
Conversation
src/TorchSharp/NN/Module.cs
Outdated
| /// <exception cref="ArgumentException"></exception> | ||
| /// <exception cref="InvalidOperationException"></exception> | ||
| public virtual void register_module(string name, Module submodule) | ||
| public virtual void add_module(string name, Module module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since they are aliases, I would suggest leaving register_module() in place and virtual, and then define add_module() as non-virtual and have it call register_module(). There's no reason for both of them to be virtual, and in case anyone has already overriden register_module, you would have a breaking code change if it's no longer virtual.
|
Hi @ChengYen-Tang -- I usually ask all contributors to introduce themselves in this thread: It is voluntary, but it's nice for everyone to know who's helping with TorchSharp. |
…odule() as non-virtual and have it call register_module().
|
Is this okay. |
It looks okay to me. As soon as I can get a clean test run (they intermittently fail due to concurrency), I'll merge. |
Can't this problem be solved? |
#904