Skip to content

Commit 9daca04

Browse files
committed
Remove Val constraint on maybe_expand_dims
1 parent 2cdbb83 commit 9daca04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/TracedRArray.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ function Base._cat(dims, A::TracedRArray{T,N}, Bs::TracedRArray...) where {T,N}
788788
return Res
789789
end
790790

791-
function maybe_expand_dims(x::AbstractArray{T,N}, ::Val{D}) where {T,N,D}
792-
D N && return x
793-
return reshape(x, ntuple(i -> i N ? size(x, i) : 1, Val(D)))
791+
function maybe_expand_dims(x::AbstractArray, dims) where {T,N}
792+
dims = dispatch_val(dims)
793+
dims N && return x
794+
return reshape(x, ntuple(i -> i N ? size(x, i) : 1, dims))
794795
end

0 commit comments

Comments
 (0)