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

Function init_dataset

examples/GRB/test_attack_defense.py:44–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42
43
44def init_dataset():
45 dataset = Cora_GRBDataset()
46 graph = copy.deepcopy(dataset.get(0))
47 device = "cuda:0" if torch.cuda.is_available() else "cpu"
48 device_ids = [0]
49 graph.to(device)
50 test_mask = graph.test_mask
51 set_random_seed(40)
52 return graph, dataset, test_mask, device, device_ids
53
54
55def init_surrogate_model(graph, dataset, test_mask, device, device_ids):

Calls 4

Cora_GRBDatasetClass · 0.90
set_random_seedFunction · 0.90
getMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected