pub fn custom_binary_op<T, F>(
x: &DenseND<T>,
y: &DenseND<T>,
op_fn: F,
) -> Result<DenseND<T>>Expand description
Custom element-wise binary operation with user-defined function
Applies a custom binary operation element-wise to two tensors with broadcasting support.
§Arguments
x- First input tensory- Second input tensorop_fn- Binary operation function: (x_elem, y_elem) -> result_elem
§Example
ⓘ
// Custom operation: (x + y) / 2
custom_binary_op(&x, &y, |a, b| (a + b) / 2.0)?;