def compare_metric(func, y, t, outputs, deriv=False, tol=0.):
    be = NervanaObject.be
    dtypeu = np.float32
    temp = func(be.array(dtypeu(y)), be.array(dtypeu(t)))
    cond = np.sum(np.abs(temp - outputs) <= tol)
    assert cond == np.prod(outputs.shape)
dataset/ETHPy150Open NervanaSystems/neon/tests/test_costs.py/compare_metric/original