Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose a hack data of Summation operation #15

Open
CIntellifusion opened this issue May 6, 2023 · 0 comments
Open

Propose a hack data of Summation operation #15

CIntellifusion opened this issue May 6, 2023 · 0 comments

Comments

@CIntellifusion
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant