Skip to content

Discrepancy between different tensor initializers contradicting docs #769

Description

@ameligrana

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions