warp.from_numpy#
- warp.from_numpy(
- arr,
- dtype=None,
- shape=None,
- device=None,
- requires_grad=False,
Returns a Warp array created from a NumPy array.
- Parameters:
arr (ndarray) – The NumPy array providing the data to construct the Warp array.
dtype (type | None) – The data type of the new Warp array. If this is not provided, the data type will be inferred.
device (Device | str | None) – The device on which the Warp array will be constructed.
requires_grad (bool) – Whether gradients will be tracked for this array.
- Raises:
RuntimeError – The data type of the NumPy array is not supported.
- Return type: