Skip to content

Avoid inplace operators in general tests #287

Open
@Illviljan

Description

@Illviljan

numpy returns scalars instead of 0d arrays:

import numpy as np
import array_api_strict as xps

xps.mean(xps.asarray(4, dtype=xps.float32)).__iadd__(1)
np.mean(np.asarray(4, dtype=np.float32)).__iadd__(1)  # AttributeError: 'numpy.float32' object has no attribute '__iadd__'

And this causes errors in unrelated tests since inplace operators are used in more generic tests:

ignore_mask |= out_zero_mask

I don't think using inplace-operators in this case is particularly important and can probably be switched to a normal bitwise or.

xref: numpy/numpy#27305

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions