Skip to main content

binary_numeric_tensors

Function binary_numeric_tensors 

Source
pub fn binary_numeric_tensors(
    lhs: &Tensor,
    rhs: &Tensor,
    context: &str,
    builtin: &str,
) -> BuiltinResult<(Vec<f64>, Vec<f64>, Vec<usize>)>
Expand description

Align two numeric tensors for a binary element-wise operation with scalar broadcasting.

Returns (lhs_data, rhs_data, output_shape). If either operand is a single element it is broadcast to the other’s length. builtin names the calling builtin and is embedded in the error message when the shapes are incompatible.