def tensor_lists_are_equal(tensor_list1: list[torch.Tensor], tensor_list2: list[torch.Tensor]) -> None:
    """Check if two lists of tensors are equal."""
    if len(tensor_list1) != len(tensor_list2):
        return False
    return all((tensor1 == tensor2).all() for tensor1, tensor2 in zip(tensor_list1, tensor_list2, strict=True))
Check if two lists of tensors are equal.
tests/unit/models/components/base/test_buffer_list_mixin.py