Skip to content

Discrepancy between different tensor initializers contradicting docs #769

@Tortar

Description

@Tortar

MWE:

julia> A = [false true; true false]
2×2 Matrix{Bool}:
 0  1
 1  0

julia> using Finch

julia> Tensor(CSFFormat(2, false, Bool), A)
2×2 Tensor{DenseLevel{Int64, SparseListLevel{Int64, Vector{Int64}, Vector{Int64}, ElementLevel{false, Bool, Int64, Vector{Bool}}}}}:
 0  1
 1  0

julia> Tensor(CSFFormat(2, false), A)
2×2 Tensor{DenseLevel{Int64, SparseListLevel{Int64, Vector{Int64}, Vector{Int64}, ElementLevel{false, Float64, Int64, Vector{Float64}}}}}:
 false   true
  true  false

Based on the docs https://finch-tensor.github.io/Finch.jl/dev/docs/tensor_formats/#Finch.CSFFormat which says that the format signature is CSFFormat(N, z = 0.0, T = typeof(z)), both tensors should be the same but instead

julia> typeof(Tensor(CSFFormat(2, false, Bool), A)) == typeof(Tensor(CSFFormat(2, false), A))
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions