operator * method

Node operator *(
  1. Node other
)

Implementation

Node operator *(Node other) {
  final out = Node(value * other.value, '*');
  out._parents = [this, other];
  out._backward.add(() {
    this.grad += other.value * out.grad;
    other.grad += value * out.grad;
  });
  return out;
}