Module ops_traits

Module ops_traits 

Source
Expand description

Operator overloading for Array

This module implements std::ops traits to enable natural operator syntax:

let a = Array::new(vec![1], vec![1.0]);
let b = Array::new(vec![1], vec![2.0]);
let c = &a + &b;  // instead of ops::add(&a, &b)
let d = &a * &b;  // instead of ops::mul(&a, &b)

Note: Operators return Array (with default dtype f32) after type promotion.