self.input_length is not defined, which affects the pickling / unpickling of this layer in tf model mode.
Description
Brief Description of the PR:
Of the two options of adding input_length or removing it entirely, it seems more elegant to remove it. The attribute input_length was likely ported from TF Embedding Layer, where it might be necessary; however, in EmbeddingBag there does not appear to be such requirements.
The alternative way to solve the issue is to take input_length as an int argument set to None but this seems likely to be more confusing and would additionally require a modification to the documentation
[x ] This PR addresses an already submitted issue for TensorFlow Addons
[ ] I have made corresponding changes to the documentation
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] This PR contains modifications to C++ custom-ops
How Has This Been Tested?
If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes:
This is a simple modification of the removal of a line which is unused. If you look in VS Code you would see that the original is undefined. This layer now works as intended in save_model and load_model.
self.input_length
is not defined, which affects the pickling / unpickling of this layer intf
model mode.Description
Brief Description of the PR:
Of the two options of adding
input_length
or removing it entirely, it seems more elegant to remove it. The attributeinput_length
was likely ported from TF Embedding Layer, where it might be necessary; however, in EmbeddingBag there does not appear to be such requirements.The alternative way to solve the issue is to take
input_length
as anint
argument set toNone
but this seems likely to be more confusing and would additionally require a modification to the documentationFixes # (issue)
2803
Type of change
Checklist:
How Has This Been Tested?
If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes:
save_model
andload_model
.