Hello!
A implementation like this may pass the original test data.
def gradient(self, out_grad, node):
return Tensor(array_api.ones_like(out_grad))
But when given 2 matrix , it fail.
So I sincerely propose to add this sample to function summation_backward() in test_autograd_hw.py of hw1
gradient_check(lambda A,C : ndl.summation(ndl.reshape(A,shape=(10,5))+C, axes=None),
ndl.Tensor(np.random.randn(50)),
ndl.Tensor(np.random.randn(10,5)), backward=True)
this originates from the last sample of function test_compute_gradient() with other operations removed.
I hope this may discover problems earlier to save time.
Thanks for your attention.
Hello!
A implementation like this may pass the original test data.
But when given 2 matrix , it fail.
So I sincerely propose to add this sample to function
summation_backward()intest_autograd_hw.pyof hw1this originates from the last sample of function
test_compute_gradient()with other operations removed.I hope this may discover problems earlier to save time.
Thanks for your attention.