Update embedding_bag.py for save_model in 'tf' mode #2804
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.