Skip to content

Test fails if no device parameter. #458

Description

@prady0t

With #443 merged, our test suite fails if no device parameter is present in the array library.

x = xp.empty(2, device=device)

array_api_tests/dtype_helpers.py:206: in is_device_dlpack_compatible
    x = xp.empty(2, device=device)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: zeros(): incompatible function arguments. The following argument types are supported:
E       1. zeros(shape: int | Sequence[int], dtype: Dtype | None = float32, *, stream: StreamOrDevice = None) -> array
E   
E   Invoked with types: int, kwargs = { device: NoneType }

A simple fix would be to put this line in the try block below.

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