Skip to content

Commit 198c8de

Browse files
authored
Check scalar output (#16)
1 parent a6f3183 commit 198c8de

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/reverse_mode.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ function _forward_eval(
323323
f.partials_storage[rhs] = zero(T)
324324
end
325325
end
326+
@assert f.sizes.ndims[1] == 0 "Final result must be scalar, got ndims = $(f.sizes.ndims[1])"
326327
return f.forward_storage[1]
327328
end
328329

0 commit comments

Comments
 (0)