pub fn sub_scalar<T: Tensor<Dtype = f32>>(t: T, val: T::Dtype) -> T
Expand description

t - val. val is used for all elements of t.

Example:

let t = Tensor1D::new([1.0, 2.0, -3.0]);
let r = t - 0.5;
assert_eq!(r.data(), &[0.5, 1.5, -3.5]);