Skip to content

Nightly tests failing around sparse COO #917

@woodsp-ibm

Description

@woodsp-ibm

Sparse, before version 0.16.0 eg in 0,15.5 the COO constructor allowed None for shape and in torch connector that default is being used

grad_coo = COO(grad_output.indices(), grad_output.values())

This resulted then in this in the logs

/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/sparse/_coo/core.py:245: DeprecationWarning: shape should be provided. This will raise a ValueError in the future.

Version 0.16.0 has now been released and it now raises a ValueError causing tests to fail. shape is now required.

      File "D:\a\qiskit-machine-learning\qiskit-machine-learning\qiskit_machine_learning\connectors\torch_connector.py", line 240, in backward
    grad_coo = COO(grad_output.indices(), grad_output.values())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\sparse\numba_backend\_coo\core.py", line 245, in __init__
    raise ValueError("`shape` was not provided.")

    ValueError: `shape` was not provided.

While we could pin sparse to < 0.16 I think the code should be changed to pass shape in the COO construction as is now required,

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