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

Commit

Permalink
clean up unnecessary prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Hao Jin committed Mar 21, 2018
1 parent 1fc0af8 commit 8b952a4
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/python/unittest/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,13 @@ def fprelu_grad(x, y, gamma):
x = mx.symbol.Variable("x")
gamma = mx.symbol.Variable("gamma")
for gam in [np.array([0.1]), np.array([0.1, 0.2, 0.3, 0.4])]:
print(gam.shape)
for dtype in ['float16', 'float32', 'float64']:
xa = np.random.uniform(low=-1.0,high=1.0,size=shape).astype(dtype)
eps = 1e-3 if dtype is 'float16' else 1e-4
xa[abs(xa) < eps] = 1.0
y = mx.symbol.LeakyReLU(data=x, gamma=gamma, act_type='prelu')
ya = fprelu(xa, gam)
g_xa, g_gam = fprelu_grad(xa, ya, gamma=gam)
print(g_xa, g_gam)
check_numeric_gradient(y, [xa, gam], numeric_eps=eps)
check_symbolic_forward(y, [xa, gam], [ya], rtol=eps, atol=1e-20)
check_symbolic_backward(y, [xa, gam], [np.ones(shape)], [g_xa], rtol=eps, atol=1e-20)
Expand Down

0 comments on commit 8b952a4

Please sign in to comment.