Currently sequenceMask in MxNDArray.java throws an error if the dimensions is 2 and use_sequence_length is set True (which currently is always the case).
Expected Behavior
Only throw error when dimensions of NDArray is less than 3 and use_sequence_length is False. If use_sequence_length then throw error if less than 2.
Error Message
sequenceMask is not supported for NDArray with less than 3 dimensions
This repo contains multiple projects, but if needed section9_6-7 uses sequenceMask as an example of what will throw an error which shouldn't.
What have you tried to solve it?
Changing the condition to only throw error if the dimensions are less than 2 works fine. This only works though because use_sequence_length is currently always True.
I haven't fully implemented this but another solution is to add a method that allows the user to enter the boolean value use_sequence_length and handle throwing the error based on the boolean.
Description
Currently sequenceMask in MxNDArray.java throws an error if the dimensions is 2 and
use_sequence_length
is set True (which currently is always the case).Expected Behavior
Only throw error when dimensions of NDArray is less than 3 and
use_sequence_length
is False. Ifuse_sequence_length
then throw error if less than 2.Error Message
sequenceMask is not supported for NDArray with less than 3 dimensions
How to Reproduce?
https://github.com/markbookk/java-d2l-IDE/blob/02a5ce874aa8d3fabc3ce944d5ab765b71c8f6fe/section9_6-7/src/main/java/Main.java#L41
Steps to reproduce
What have you tried to solve it?
use_sequence_length
is currently always True.use_sequence_length
and handle throwing the error based on the boolean.Environment Info