willow-ahrens / Finch.jl

Sparse tensors in Julia and more! Datastructure-driven array programing language.
http://willowahrens.io/Finch.jl/
MIT License
151 stars 12 forks source link

`maximum`, `minimum` always return `float` eltype #578

Closed mtsokol closed 3 weeks ago

mtsokol commented 1 month ago

Hi @willow-ahrens,

I think reduction functions could adhere to promotion rules instead of always returning float data type:

julia> using Finch

julia> maximum(Tensor(ones(Int8, 4,4)))
1.0

julia> minimum(Tensor(ones(Int8, 4,4)))
1.0