MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / cross_check

Function cross_check

examples/tensorflow/bert/utils/common.py:90–94  ·  view source on GitHub ↗
(name, tf_val, op_val, atol_threshold)

Source from the content-addressed store, hash-verified

88 return time_sum * 1000 / iterations
89
90def cross_check(name, tf_val, op_val, atol_threshold):
91 abs_diff = np.fabs(tf_val - op_val)
92 print("[INFO] {} Cross check {}".format(name, np.allclose(tf_val, op_val, atol=atol_threshold)))
93 print("[INFO] Max diff {}".format(abs_diff.max()))
94 print("[INFO] min diff {}".format(abs_diff.min()))
95
96def int_result_cross_check(name, tf_result, op_result, shape):
97 print(" ")

Callers 2

encoder_exampleFunction · 0.90
bert_exampleFunction · 0.90

Calls 2

maxMethod · 0.80
minMethod · 0.80

Tested by

no test coverage detected