Jutho / TensorOperations.jl

Julia package for tensor contractions and related operations
https://jutho.github.io/TensorOperations.jl/stable/
Other
453 stars 56 forks source link

`similar_from_structure` always call `fill!` which is not need for `bitstype` #114

Closed jemiryguo closed 2 years ago

jemiryguo commented 2 years ago

In tensorcache.jl around line 9

function similar_from_structure(A, T, structure)
    if isbits(T)
        similar(A, T, structure)
    else
        fill!(similar(A, T, structure), zero(T)) # this fixes BigFloat issues
    end
end

T is a Type, isbits(T::Type) always return false. Maybe isbitstype should be used?