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
Removed redundant code and modified embedding_modules file #655
Conversation
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.
Thanks for this PR. I would change a few things:
- leave the regularizer part out
- rename the function to
embedding_matrix_on_device
- move the function to
embedding_modules.py
@w4nderlust Could you please clarify your first and last points? The function is still in |
|
Aah okay, that is indeed a good precautionary step. Thanks for the insight. |
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.
In your last commit you are removing regularize
that you introduced previously. That is correct, \regularize\ is never used, but you should pass regularizer
as it is provided by the functions calling embedding_matrix_on_device
.
To recap embedding_matrix_on_device
needs to have a regularizer
parameter as it is needed by embedding_matrix
and all __call__
functions using embedding_matrix_on_device
should doL
if not self.regularize:
regularizer = None
and then pass the regularizer
to the call to embedding_matrix_on_device
as they were passing it to embedding_matrix
before your edits.
@w4nderlust I am afraid I am not so sure about what you are trying to convey. But, in the code, the function |
Ah you moved it around from the bottom, that's fine then |
I removed redundant code in embedding_modules file and added them to a new set_embed_para function.