Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
add shape checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaiBapchya committed Jul 27, 2020
1 parent 629175f commit e170000
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/nightly/test_large_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,8 +1220,10 @@ def run_gemm2(inp1,inp2):
inp2=mx.nd.ones(shape=(LARGE_X, SMALL_Y))
inp1_grad, inp2_grad, out= run_gemm2(inp1,inp2)
assert out.asnumpy()[0][0] == LARGE_X
assert out.shape() == (SMALL_Y, SMALL_Y)
out.backward()
assert inp1_grad.asnumpy()[0][0] == SMALL_Y
assert inp1_grad.asnumpy()[0][0] == (SMALL_Y, LARGE_X)
assert inp2_grad.asnumpy()[0][0] == (LARGE_X, SMALL_Y)
assert_almost_equal(inp2_grad.asnumpy()[0][0],49.1)


Expand Down

0 comments on commit e170000

Please sign in to comment.