How grad_b is upgrading?

In get_grads function value of grad_b is defined equal to 0.0 when i is iterating over all the m grad_b will going to get the value of the last example of X because there is no + used when we used grad_b = -1 *(y_true[i] - hx) it should be
grad_b += -1 *(y_true[i] - hx)
please correct me if i am wrong