We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
dim(::Tensor, ::Symbol)
1 parent 3b387a5 commit 3e661a3Copy full SHA for 3e661a3
src/Tensor.jl
@@ -152,7 +152,7 @@ parenttype(::T) where {T<:Tensor} = parenttype(T)
152
Return the location of the dimension of `tensor` corresponding to the given index `i`.
153
"""
154
dim(::Tensor, i::Number) = i
155
-dim(t::Tensor, i::Symbol) = first(findall(==(i), inds(t)))
+dim(t::Tensor, i::Symbol) = findfirst(==(i), vinds(t))
156
157
# Iteration interface
158
Base.IteratorSize(T::Type{Tensor}) = Iterators.IteratorSize(parenttype(T))
0 commit comments