def tensors_allclose(a_tensors, b_tensors, rtol=0, atol=1e-7):
    # deal with individual tensor
    if type(a_tensors) is not list and type(b_tensors) is not list:
        a_tensors = [a_tensors]
        b_tensors = [b_tensors]
    results = []
    for a_tensor, b_tensor in zip(a_tensors, b_tensors):
        if isinstance(a_tensor, Tensor):
            a_tensor = a_tensor.get()
        if isinstance(b_tensor, Tensor):
            b_tensor = b_tensor.get()
        results.append(allclose_with_out(a_tensor.astype(b_tensor.dtype),
                                         b_tensor,
                                         rtol=rtol, atol=atol))

    return all(results)
For each backends, calls f with its tensors, and returns the results to
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/tests/utils.py/tensors_allclose