Unverified Commit 91b1b7f3 authored by Jeff Rasley's avatar Jeff Rasley Committed by GitHub
Browse files

[transformer-kernel] turn off unit test printing (#701)

parent cd29f8b8
...@@ -24,6 +24,7 @@ def check_equal(first, second, atol=1e-2, verbose=False): ...@@ -24,6 +24,7 @@ def check_equal(first, second, atol=1e-2, verbose=False):
diction_x = {} diction_x = {}
diction_y = {} diction_y = {}
if verbose:
for i, (x, y) in enumerate(zip(first, second)): for i, (x, y) in enumerate(zip(first, second)):
print(x[1], y[1]) print(x[1], y[1])
...@@ -43,11 +44,13 @@ def check_equal(first, second, atol=1e-2, verbose=False): ...@@ -43,11 +44,13 @@ def check_equal(first, second, atol=1e-2, verbose=False):
for i, (x, y) in enumerate(zip(diction_x, diction_y)): for i, (x, y) in enumerate(zip(diction_x, diction_y)):
if (x[0] == 1): continue if (x[0] == 1): continue
if verbose:
print("checking ", x[1], ":") print("checking ", x[1], ":")
y = diction_y[x[0], x[1]] y = diction_y[x[0], x[1]]
x = diction_x[x[0], x[1]] x = diction_x[x[0], x[1]]
x = x.cpu().detach().numpy() x = x.cpu().detach().numpy()
y = y.cpu().detach().numpy() y = y.cpu().detach().numpy()
if verbose:
print(x) print(x)
print(y) print(y)
...@@ -60,8 +63,8 @@ def check_equal(first, second, atol=1e-2, verbose=False): ...@@ -60,8 +63,8 @@ def check_equal(first, second, atol=1e-2, verbose=False):
if avgx != float('inf') and avgx != -float('inf'): if avgx != float('inf') and avgx != -float('inf'):
avgx = avgx / countx avgx = avgx / countx
tollerance = avgx * atol tollerance = avgx * atol
print("tollerance is ", tollerance)
if verbose: if verbose:
print("tollerance is ", tollerance)
print("x = {}".format(x.flatten())) print("x = {}".format(x.flatten()))
print("y = {}".format(y.flatten())) print("y = {}".format(y.flatten()))
print('-' * 80) print('-' * 80)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment