JaxLike¶
- class probly.representation.jax_like.JaxLike(*args, **kwargs)[source]¶
Bases:
ArrayLike,Protocol,GenericProtocol for array-like objects that implement JAX-specific APIs.
Every member declared here also exists on a real
jax.Array, otherwiseisinstance(jnp.ones(3), JaxLike)would silently be False. That rules out__jax_function__, which is declared onJaxLikeImplementationinstead.- astype(dtype: DTypeLike | None, copy: bool = False, device: jax.Device | Sharding | None = None) Self[source]¶
Return a copy of the array cast to the given data type.
- block_until_ready() Self[source]¶
Block until the asynchronous computation of the array has finished.
- reshape(*args: int | Sequence[int], order: str = 'C') Self[source]¶
Return a reshaped version of the array.
- squeeze(axis: int | Sequence[int] | None = None) Self[source]¶
Return the array with axes of length one removed.
- to_device(device: Literal['cpu'], /, *, stream: int | Any | None = None) Self[source]¶
Move the array to a device.