Skip to content

Commit 48efd07

Browse files
committed
embedding_layer: guard against zeros
1 parent e6b54de commit 48efd07

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/nf/nf_embedding_layer_submodule.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ pure module subroutine forward(self, input)
3434
index = input(i)
3535
if (index > size(self % weights, 1)) then
3636
index = 1
37+
elseif (index == 0) then
38+
index = 1
3739
end if
3840
self % output(i, :) = self % weights(index, :)
3941
end do

0 commit comments

Comments
 (0)