GithubHelp home page GithubHelp logo

Comments (3)

rayegun avatar rayegun commented on September 27, 2024

For some reason Base.Broadcast.combine_eltypes returns Any for your operands. Even dense:

julia> A = rand(ArbFloat, 2)
2-element Vector{ArbFloat}:
 0.2154487845270057641299827610966
 0.09626764182552727242704068481935

julia> B = rand(ArbFloat, 2)
2-element Vector{ArbFloat}:
 0.6275663792273822768657185851517
 0.06658759509104976444220998662436

julia> Base.Broadcast.combine_eltypes(+, (A, B))
Any

julia> @which Base.Broadcast.combine_eltypes(+, (A, B))
combine_eltypes(f, args::Tuple)
     @ Base.Broadcast broadcast.jl:757

julia> Base.Broadcast.eltypes((A, B))
Tuple{ArbFloat, ArbFloat}

julia> Base.promote_typejoin_union(Base._return_type(+, ans))
Any

That last one is particularly suspicious to me, although I may be doing something wrong.

from sparsearrays.jl.

rayegun avatar rayegun commented on September 27, 2024
julia> Base.return_types(+, Tuple{ArbFloat, ArbFloat})
2-element Vector{Any}:
 ArbFloat
 Any

Yeah this seems to be some sort of type instability in addition of ArbFloats perhaps?

from sparsearrays.jl.

rayegun avatar rayegun commented on September 27, 2024

ArbFloat is not concrete. You need to do spzeros(ArbFloat{128}, 2). While we don't specify that SparseMatrixCSC eltypes be concrete, it's not something we really support.

In this case at least you would have to define +(x::ArbFloat, y::ArbFloat) = ... rather than +(x::ArbFloat{P}, y::ArbFloat{P}) as is done now.

from sparsearrays.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.