rlmesh.jax.asarray

functionExperimentalfrom rlmesh.jax import asarray[source]

Return an immutable JAX array for an RLMesh tensor.

asarray(tensor: Tensor | bool | int | float) -> JaxArray

Imports 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

NameTypeDescription
tensorTensor | bool | int | floatRLMesh tensor or scalar primitive to convert.

Returns

TypeDescription
JaxArrayJAX array (immutable); shares the tensor buffer when XLA can, and
JaxArraycopies otherwise.