Update error handling logic in convolutional.ts #8248
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.
Hi, Team
I have updated error handling code in this file tfjs/tfjs-layers/src/layers/convolutional.ts the if statement checks if bias is not null and its shape.length (number of dimensions) is not equal to 1. This is the correct check to ensure a valid bias tensor for a 1D convolution.However, the error message incorrectly references
kernel.shape.length
when it should be referencingbias.shape.length
. If I'm not wrong, it seems like there is typo while writing error handling code logic so please do the needful.The following error message would be more accurate and clearly indicates that the issue lies with the number of dimensions in the bias tensor, not the kernel.
I would request you to please review the changes and if you've any suggestion or feedback please let me know. Thank you.