def test_incompatible_higher_rank_inputs_raises(self,
                                                  use_edges,
                                                  use_nodes,
                                                  use_globals,
                                                  field):
    """A exception should be raised if the inputs have incompatible shapes."""
    input_graph = self._get_shaped_input_graph()
    input_graph = input_graph.replace(
        **{field: tf.transpose(getattr(input_graph, field), [0, 2, 1, 3])})
    network = blocks.GlobalBlock(
        functools.partial(snt.Conv2D, output_channels=10, kernel_shape=[3, 3]),
        use_edges=use_edges,
        use_nodes=use_nodes,
        use_globals=use_globals
    )
    with self.assertRaisesRegexp(ValueError, "in both shapes must be equal"):
      network(input_graph)