pub fn binary_map<T: Tensor<Dtype = f32>, F, Dfdx, Dfdy>(
lhs: &T::NoTape,
rhs: T,
f: F,
dfdx: Dfdx,
dfdy: Dfdy
) -> T where
F: FnMut(&f32, &f32) -> f32 + Copy,
Dfdx: FnMut(&f32, &f32) -> f32 + Copy,
Dfdy: FnMut(&f32, &f32) -> f32 + Copy,
Expand description
Applies a binary function f
, it’s partial wrt. x dfdx
, and its partial wrt. y dfdy
to a pair of Tensors lhs
and `rhs.
This is primarily used to implement add(), sub(), mul(), and div().