def compare_tensors(func, param_list, param2, tol=0., epoch=1):
    func.optimize([DummyLayer(param_list)], epoch=epoch)
    (param, grad), states = param_list[0]
    cond = np.sum(np.abs(param.get() - param2) <= tol)
    assert cond == np.prod(param2.shape)
dataset/ETHPy150Open NervanaSystems/neon/tests/test_optimizer.py/compare_tensors/original