{ } Raw JSON

bundles / scipy latest / scipy / _lib / array_api_extra / _lib / _at / at / _op

function

scipy._lib.array_api_extra._lib._at:at._op

source: /scipy/_lib/array_api_extra/_lib/_at.py :224

Signature

def   _op ( self at_op : _AtOp in_place_op : Callable[[Array, Array | complex], Array] | None out_of_place_op : Callable[[Array, Array], Array] | None y : Array | complex / copy : bool | None xp : ModuleType | None )  →  Array

Summary

Implement all update operations.

Parameters

at_op : _AtOp

Method of JAX's Array.at[].

in_place_op : Callable[[Array, Array | complex], Array] | None

In-place operation to apply on mutable backends

x[idx] = in_place_op(x[idx], y)

If None

x[idx] = y
out_of_place_op : Callable[[Array, Array], Array] | None

Out-of-place operation to apply when idx is a boolean mask and the backend doesn't support in-place updates

x = xp.where(idx, out_of_place_op(x, y), x)

If None

x = xp.where(idx, y, x)
y : array or complex

Right-hand side of the operation.

copy : bool or None

Whether to copy the input array. See the class docstring for details.

xp : array_namespace, optional

The array namespace for the input array. Default: infer.

Returns

: Array

Updated x.

Aliases

  • scipy.differentiate.xpx.at._op