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 += out.grad;
    other.grad += out.grad;
  });
  return out;
}