How to use get_partition_list method in autotest

Best Python code snippet using autotest_python

graphClusterSampler.py

Source:graphClusterSampler.py Github

copy

Full Screen

...28 if os.path.exists(fn):29 self.par_li = np.load(fn, allow_pickle=True)30 else:31 os.makedirs('./datasets/', exist_ok=True)32 self.par_li = get_partition_list(g, psize)33 np.save(fn, self.par_li)34 else:35 self.par_li = get_partition_list(g, psize)36 par_list = []37 total_nodes = 038 for p in self.par_li:39 total_nodes = total_nodes + len(p)40 par = torch.Tensor(p)41 par_list.append(par)42 self.par_list = par_list43 print('Partition number = {} over {} nodes on graph with {} nodes'.format(len(par_list), total_nodes, g.num_nodes()))44 def __len__(self):45 return self.psize46 def __getitem__(self, idx):47 return self.par_li[idx]48def subgraph_collate_fn(g, batch):49 nids = np.concatenate(batch).reshape(-1).astype(np.int64)...

Full Screen

Full Screen

sampler.py

Source:sampler.py Github

copy

Full Screen

...13 if os.path.exists(fn):14 self.par_li = np.load(fn, allow_pickle=True)15 else:16 os.makedirs('./partitions/', exist_ok=True)17 self.par_li = get_partition_list(g, psize)18 np.save(fn, self.par_li)19 else:20 self.par_li = get_partition_list(g, psize)21 par_list = []22 for p in self.par_li:23 par = torch.Tensor(p)24 par_list.append(par)25 self.par_list = par_list26 def __len__(self):27 return self.psize28 def __getitem__(self, idx):29 return self.par_li[idx]30def subgraph_collate_fn(g, batch):31 nids = np.concatenate(batch).reshape(-1).astype(np.int64)32 g1 = g.subgraph(nids)33 return g134def ClusterIter(dn, g, psize, batch_size, seed_nid=None):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful