Skip to content

Commit

Permalink
Apply suggestion to check for d > 0 as well
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Smirnov <[email protected]>
  • Loading branch information
gruberchr and pxl-th authored Jul 31, 2024
1 parent f933bff commit 920f362
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/layers/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Dense(W::LinearAlgebra.Diagonal, bias = true, σ = identity) =
Scale(W.diag, bias, σ)

function _size_check(layer, x::AbstractArray, (d, n)::Pair)
d <= ndims(x) || throw(DimensionMismatch(string("layer ", layer,
0 < d <= ndims(x) || throw(DimensionMismatch(string("layer ", layer,
" expects ndims(input) >= ", d, ", but got ", summary(x))))
size(x, d) == n || throw(DimensionMismatch(string("layer ", layer,
lazy" expects size(input, $d) == $n, but got ", summary(x))))
Expand Down

0 comments on commit 920f362

Please sign in to comment.