Skip to content

Commit

Permalink
Fix function _size_check()
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberchr committed Jul 26, 2024
1 parent 8c15898 commit f933bff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/layers/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ Dense(W::LinearAlgebra.Diagonal, bias = true, σ = identity) =
Scale(W.diag, bias, σ)

function _size_check(layer, x::AbstractArray, (d, n)::Pair)
d > 0 || throw(DimensionMismatch(string("layer ", layer,
" expects ndims(input) > ", ndims(x)-d, ", but got ", summary(x))))
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))))
end
Expand Down

0 comments on commit f933bff

Please sign in to comment.