<s> import numpy as np <EOL> import numpy . random as npr <EOL> import kayak <EOL> from . import * <EOL> def test_reshape_1 ( ) : <EOL> npr . seed ( <NUM_LIT:1> ) <EOL> np_A = npr . randn ( <NUM_LIT:5> , <NUM_LIT:10> ) <EOL> A = kayak . Parameter ( np_A ) <EOL> B = kayak . Reshape ( A , ( <NUM_LIT> , <NUM_LIT:2> ) ) <EOL> B . value <EOL> assert B . shape == ( <NUM_LIT> , <NUM_LIT:2> ) <EOL> def test_reshape_2 ( ) : <EOL> npr . seed ( <NUM_LIT:2> ) <EOL> np_A = npr . randn ( <NUM_LIT:5> , <NUM_LIT:10> ) <EOL> A = kayak . Parameter ( np_A ) <EOL> B = kayak . Reshape ( A , ( <NUM_LIT:2> , <NUM_LIT> ) ) <EOL> C = kayak . Parameter ( npr . randn ( <NUM_LIT> , <NUM_LIT:5> ) ) <EOL> D = kayak . MatMult ( B , C ) <EOL> out = kayak . MatSum ( D ) <EOL> out . value <EOL> assert out . grad ( A ) . shape == np_A . shape <EOL> assert kayak . util . checkgrad ( A , out ) < MAX_GRAD_DIFF </s>
