fix test_word2vec bug (#15462)

fix test_word2vec float's equality bug
inference-pre-release-gpu
flame 6 years ago committed by GitHub
parent b3fdf708f1
commit f534c66d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -220,9 +220,7 @@ def infer(use_cuda, save_dirname=None):
np_data = np.array(results[0])
infer_out = infer_outputs[0].data.float_data()
for a, b in zip(np_data[0], infer_out):
g_a = float("{:.6g}".format(a))
g_b = float("{:.6g}".format(b))
assert g_a == g_b
assert np.isclose(a, b), "a: {}, b: {}".format(a, b)
def main(use_cuda, is_sparse, is_parallel):

Loading…
Cancel
Save