pangolin.interface.constant#
- pangolin.interface.constant(value, /)#
Create an interface RV representing a fixed numeric value.
valueis normalized bypangolin.ir.Constantto an immutable NumPy array. Scalars remain scalar-shaped, while nested sequences and arrays retain their array shape.- Parameters:
value (ArrayLike) – A numeric scalar, sequence, NumPy array, JAX array, or other numeric array-like value.
- Raises:
ValueError – If
valueis empty or does not have a numeric dtype.- Return type:
Examples
>>> from pangolin import interface as pi >>> pi.constant(7) RV(Constant(7)) >>> x = pi.constant([[1, 2], [3, 4]]) >>> x.shape (2, 2)