def test_incompatible_higher_rank_inputs_raises(self):
    """A exception should be raised if the inputs have incompatible shapes."""
    input_graph = self._get_shaped_input_graph()
    _, node_model_fn, global_model_fn = self._get_shaped_model_fns()
    input_graph = input_graph.replace(
        nodes=tf.transpose(input_graph.nodes, [0, 2, 1, 3]))
    graph_network = modules.DeepSets(node_model_fn, global_model_fn)
    with self.assertRaisesRegex(
        tf.errors.InvalidArgumentError,
        "Dimensions of inputs should match"):
      graph_network(input_graph)
A exception should be raised if the inputs have incompatible shapes.
graph_nets/tests_tf2/modules_test.py