def has_same_architecture(a, b):
    """
    Checks for architectural equality between models using parameter names and shapes,
    essentially testing for state_dict compatibility between the two inputs
    """
    for (a_name, a_var), (b_name, b_var) in zip(a.named_parameters(), b.named_parameters()):
        if a_name != b_name or a_var.shape != b_var.shape:
            return False
    return True