rlmesh.jax.asarray
Return an immutable JAX array for an RLMesh tensor.
asarray(tensor: Tensor | bool | int | float) -> JaxArrayImports over DLPack: XLA shares 64-byte-aligned buffers (zero copy, the
result may alias the wire buffer) and copies otherwise. Either way JAX
arrays are immutable, so there is no mutation hazard and no copy=
knob. Scalar primitives (bool/int/float) are accepted for
symmetry with rlmesh.torch.as_tensor() and become 0-d arrays.
Parameters
| Name | Type | Description |
|---|---|---|
tensor | Tensor | bool | int | float | RLMesh tensor or scalar primitive to convert. |
Returns
| Type | Description |
|---|---|
JaxArray | JAX array (immutable); shares the tensor buffer when XLA can, and |
JaxArray | copies otherwise. |