def METHOD_NAME(
    self,
    input: TensorOrArray,
    other: TensorOrArray,
    *,
    rtol: float = 1e-05,
    atol: float = 1e-08,
    equal_nan: bool = False,
    msg: Optional[str] = None,
) -> None:
    """
    Verifies that two tensors or arrays have the same shape and are close
        given absolute and relative tolerance, i.e. checks
        `all(|input - other| <= atol + rtol * |other|)`;
        raises AssertionError otherwise.
    Args:
        input, other: two tensors or two arrays.
        rtol, atol, equal_nan: as for torch.allclose.
        msg: message in case the assertion is violated.
    Note:
        Optional arguments here are all keyword-only, to avoid confusion
        with msg arguments on other assert functions.
    """
    self.assertEqual(np.shape(input), np.shape(other))
    backend = torch if torch.is_tensor(input) else np
    close = backend.allclose(
        input, other, rtol=rtol, atol=atol, equal_nan=equal_nan
    )
    if close:
        return
    # handle bool case
    if backend == torch and input.dtype == torch.bool:
        diff = (input != other).float()
        ratio = diff
    if backend == np and input.dtype == bool:
        diff = (input != other).astype(float)
        ratio = diff
    else:
        diff = backend.abs(input + 0.0 - other)
        ratio = diff / backend.abs(other)
    try_relative = (diff <= atol) | (backend.isfinite(ratio) & (ratio > 0))
    if try_relative.all():
        if backend == np:
            # Avoid a weirdness with zero dimensional arrays.
            ratio = np.array(ratio)
        ratio[diff <= atol] = 0
        extra = f" Max relative diff {ratio.max()}"
    else:
        extra = ""
    shape = tuple(input.shape)
    loc = np.unravel_index(int(diff.argmax()), shape)
    max_diff = diff.max()
    err = f"Not close. Max diff {max_diff}.{extra} Shape {shape}. At {loc}."
    if msg is not None:
        self.fail(f"{msg} {err}")
    self.fail(err)