10-zin / cpp-micrograd

A c/c++ implementation of micrograd: a tiny autograd engine with neural net on top.
MIT License
61 stars 7 forks source link

It is not possible to implement multiplication between a double type and a Value type, as well as compound operations like std::shared_ptr<Value> value1_2 = value1 + (value2 * 3.0); #2

Open ghost-s opened 10 months ago

ghost-s commented 10 months ago

more details are following: std::shared_ptr value1 = std::make_shared(2.5); std::shared_ptr value2 = std::make_shared(3.7); std::shared_ptr value3 = std::make_shared(-3.0); std::shared_ptr value4 = std::make_shared(1.7);

// Perform addition using the operator+
std::shared_ptr<Value> value1_2 = value1 + (value2 * 3.0);   # error