Closed mtsokol closed 4 months ago
Hi @willow-ahrens,
While implementing Array API standard I noticed that one-element 1-D tensors drop their values for some broadcasted operations:
julia> using Finch julia> Tensor(ones(1)) Dense [1:1] └─ [1]: 1.0 julia> broadcast(trunc, swizzle(Tensor(ones(1)), 1)) # <-- here 1.0 disappears Dense [1:0] julia> Tensor(ones(2)) Dense [1:2] ├─ [1]: 1.0 └─ [2]: 1.0 julia> broadcast(trunc, swizzle(Tensor(ones(2)), 1)) Dense [1:2] ├─ [1]: 1.0 └─ [2]: 1.0
I think this is a dup of https://github.com/willow-ahrens/Finch.jl/issues/533, and I'm currently working on a fix. I'll add these tests too and close this issue only if that resolves it
Hi @willow-ahrens,
While implementing Array API standard I noticed that one-element 1-D tensors drop their values for some broadcasted operations: