Skip to content

Commit 3e661a3

Browse files
committed
Fix type-inference in dim(::Tensor, ::Symbol)
1 parent 3b387a5 commit 3e661a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Tensor.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ parenttype(::T) where {T<:Tensor} = parenttype(T)
152152
Return the location of the dimension of `tensor` corresponding to the given index `i`.
153153
"""
154154
dim(::Tensor, i::Number) = i
155-
dim(t::Tensor, i::Symbol) = first(findall(==(i), inds(t)))
155+
dim(t::Tensor, i::Symbol) = findfirst(==(i), vinds(t))
156156

157157
# Iteration interface
158158
Base.IteratorSize(T::Type{Tensor}) = Iterators.IteratorSize(parenttype(T))

0 commit comments

Comments
 (0)