Skip to content

Change handling of sparse backends #38

Closed
@gdalle

Description

@gdalle

Problems:

Suggested solutions (instead of #37):

  • Replace AutoSparseBackend with a wrapper struct AutoSparse(AutoBackend)
  • Add fields to this wrapper struct for sparse-specific ingredients
struct AutoSparse{B<:AbstractADType,S,C} <: AbstractADType
    backend::B
    sparsity_detector::S
    coloring_algorithm::C
end

To preserve backwards-compatibility we can try to define shortcuts like the following, to be removed in v0.3.0:

const AutoSparseBackend = AutoSparse{<:AutoBackend}

function AutoSparseBackend(args...; sparsity_detector, coloring_algorithm, kwargs...)
    backend = AutoBackend(args...; kwargs...)
    return AutoSparse(backend, sparsity_detector, coloring_algorithm)
end

However I'm not 100% sure we can keep this from being breaking.

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