finch-tensor / Finch.jl

Sparse and Structured Tensor Compiler
http://willowahrens.io/Finch.jl/
MIT License
161 stars 16 forks source link

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

Closed mtsokol closed 4 months ago

mtsokol commented 4 months 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