Skip to content
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

Fixing SequenceMask bug related to Issue #802 #828

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ public NDArray booleanMask(NDArray index, int axis) {
/** {@inheritDoc} */
@Override
public NDArray sequenceMask(NDArray sequenceLength, float value) {
if (getShape().dimension() < 3 || getShape().isScalar() || getShape().hasZeroDimension()) {
if (getShape().dimension() < 2 || getShape().isScalar() || getShape().hasZeroDimension()) {
throw new IllegalArgumentException(
"sequenceMask is not supported for NDArray with less than 3 dimensions");
"sequenceMask is not supported for NDArray with less than 2 dimensions");
}
Shape expectedSequenceLengthShape = new Shape(getShape().get(0));
if (!sequenceLength.getShape().equals(expectedSequenceLengthShape)) {
Expand Down