operator * method

Value operator *(
  1. dynamic other
)

Implementation

Value operator *(dynamic other) {
  final o = Value.toValue(other);
  final out = Value(data * o.data, {this, o}, '*');
  out._backward = () {
    grad += o.data * out.grad; // Correct gradient for this
    o.grad += data * out.grad; // Correct gradient for o
  };
  return out;
}