def test_smoothL1_random(backend_default, fargs):
    s1, s2, m = fargs
    shape = (s1, s2)
    magnitude = m
    outputs = (0.5 - np.random.random(shape)) * magnitude
    targets = np.random.random(shape)
    x = outputs - targets
    expected_result = np.zeros(shape)
    I1, J1 = np.where(abs(x) < 1)
    I2, J2 = np.where(abs(x) >= 1)
    expected_result[I1, J1] = 0.5 * x[I1, J1]**2
    expected_result[I2, J2] = abs(x[I2, J2]) - 0.5
    expected_result = np.sum(expected_result, axis=0, keepdims=True)
    compare_tensors(SmoothL1Loss(), outputs,
                    targets, expected_result,
                    deriv=False, tol=1e-5)
dataset/ETHPy150Open NervanaSystems/neon/tests/test_costs.py/test_smoothL1_random/swapped operands of `-`