def test_created_variables(self, name=None):
    """Verifies variable names and shapes created by a GraphIndependent."""
    name = name if name is not None else "graph_independent"
    expected_var_shapes_dict = {
        name + "/edge_model/mlp/linear_0/b:0": [5],
        name + "/edge_model/mlp/linear_0/w:0": [4, 5],
        name + "/node_model/mlp/linear_0/b:0": [10],
        name + "/node_model/mlp/linear_0/w:0": [2, 10],
        name + "/global_model/mlp/linear_0/b:0": [15],
        name + "/global_model/mlp/linear_0/w:0": [3, 15],
    }
    input_graph = self._get_input_graph()
    model = self._get_model(name=name)

    model(input_graph)
    variables = model.variables
    var_shapes_dict = {var.name: var.get_shape().as_list() for var in variables}
    self.assertDictEqual(expected_var_shapes_dict, var_shapes_dict)
Verifies variable names and shapes created by a GraphIndependent.
graph_nets/tests_tf2/modules_test.py