Skip to main contentModule tensor
Source - binary_numeric_tensors
- Align two numeric tensors for a binary element-wise operation with scalar broadcasting.
- clamp_u8
- Clamp a scalar f64 to the uint8 range [0, 255], rounding to the nearest integer.
- clamp_u16
- Clamp a scalar f64 to the uint16 range [0, 65535], rounding to the nearest integer.
- coerce_tensor_dtype
- Cast all elements of a tensor to the target dtype in-place, preserving the f64 backing store.
- default_shape_for
- Return a canonical 2-D shape for a tensor given its shape slice and element count.
- dimension_from_value_async
- Attempt to parse a dimension index from a scalar-like runtime value.
- dims_from_value_async
- Attempt to parse a dimension vector from a runtime value asynchronously.
- element_count
- Return the total number of elements for a given shape.
- is_scalar_tensor
- Return true when a tensor contains exactly one scalar element.
- logical_to_tensor
- Convert a logical array (0/1 bytes) into a numeric tensor.
- ones
- Construct an one-filled tensor with the provided shape.
- ones_with_dtype
- Construct a one-filled tensor with an explicit dtype flag.
- parse_dimension
- Convert an argument into a dimension index (1-based) if possible.
- scalar_f64_from_value_async
- Attempt to extract a scalar f64 from a runtime value asynchronously.
- tensor_into_value
- Convert a
Tensor back into a runtime value. - value_into_tensor
- Convert a
Value into an owned Tensor, defaulting error messages to "sum". - value_into_tensor_for
- Convert a
Value into a tensor while customising the builtin name in error messages. - value_to_string
- Attempt to extract a string from a runtime value.
- value_to_tensor
- Clone a
Value and coerce it into a tensor. - zeros
- Construct a zero-filled tensor with the provided shape.
- zeros_with_dtype
- Construct a zero-filled tensor with an explicit dtype flag.