In gradient function why we are not inserting one more loop of range(w.shape) and not including indexing to w

in gradient function why we are not inserting one more loop of range(w.shape) and not including indexing to w