Skip to content

Propose a hack data of Summation operation #15

@CIntellifusion

Description

@CIntellifusion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions