MCPcopy Create free account
hub / github.com/IntelligentSystemsLab/ST-EVCDP / CreateDataset

Class CreateDataset

functions.py:87–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86
87class CreateDataset(Dataset):
88 def __init__(self, occ, prc, lb, pt, device, adj): # adj
89 occ, label = create_rnn_data(occ, lb, pt)
90 prc, _ = create_rnn_data(prc, lb, pt)
91 self.occ = torch.Tensor(occ)
92 self.prc = torch.Tensor(prc)
93 self.label = torch.Tensor(label)
94 self.device = device
95
96 def __len__(self):
97 return len(self.occ)
98
99 def __getitem__(self, idx): # occ: batch, seq, node
100 output_occ = torch.transpose(self.occ[idx, :, :], 0, 1).to(self.device)
101 output_prc = torch.transpose(self.prc[idx, :, :], 0, 1).to(self.device)
102 output_label = self.label[idx, :].to(self.device)
103 return output_occ, output_prc, output_label
104
105
106class CreateFastDataset(Dataset):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected