MCPcopy
hub / github.com/THUDM/CogDL / process

Method process

docs/source/examples/3custom_dataset.py:59–67  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57 super(MyGraphDataset, self).__init__(path, metric="accuracy")
58
59 def process(self):
60 # Load and preprocess data
61 # Here we randomly generate several graphs for simplicity as an example
62 graphs = []
63 for i in range(10):
64 edges = torch.randint(0, 20, (2, 30))
65 label = torch.randint(0, 7, (1,))
66 graphs.append(Graph(edge_index=edges, y=label))
67 return graphs
68
69if __name__ == "__main__":
70 dataset = MyGraphDataset()

Callers

nothing calls this directly

Calls 1

GraphClass · 0.90

Tested by

no test coverage detected