Skip to content

at.set methods raise "assignment destination is read-only" with array_api_strict arrays #506

@mdhaber

Description

@mdhaber

at.set rnethods return modified copies of read-only NumPy arrays, but they raise for read-only array_api_strict arrays.

import array_api_extra as xpx
import array_api_strict as xp
# import numpy as xp  # NumPy works

x = xp.zeros(())
x = xp.broadcast_to(x, (2,))
x = xpx.at(x)[0].set(1)
# ValueError: assignment destination is read-only

While we're at it, what do you think about making ... a default value for the second argument/index of at?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions