jittor
jittor copied to clipboard
交叉熵损失函数test_cross_entropy_weight_ignore 参数ignore_index 无效导致结果不对
FAIL: test_cross_entropy_weight_ignore (main.TestLoss)
Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/jittor/test/test_loss.py", line 143, in test_cross_entropy_weight_ignore np.testing.assert_allclose(jt_y.numpy(), tc_y.numpy()) File "/usr/local/lib/python3.7/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose verbose=verbose, header=header, equal_nan=equal_nan) File "/usr/local/lib/python3.7/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare raise AssertionError(msg) AssertionError: Not equal to tolerance rtol=1e-07, atol=0
Mismatched elements: 1 / 1 (100%) Max absolute difference: 3.5762787e-07 Max relative difference: 2.4215984e-07 x: array([1.476825], dtype=float32) y: array(1.476826, dtype=float32)
Ran 10 tests in 22.098s
this result is ok, the difference is very small.