17e56b9100275068c7ad0e74c0bf247866da846f,torch_geometric/utils/geodesic.py,,geodesic_distance,#Any#Any#Any#Any#Any#Any#,10
Before Change
dest = None if dest is None else dest.detach().cpu().to(torch.int).numpy()
outs = []
for i in range(len(src)):
s = src[i:i + 1]
d = None if dest is None else dest[i:i + 1]
out = gdist.compute_gdist(pos, face, s, d, max_distance * norm) / norm
out = torch.from_numpy(out).to(dtype)
outs.append(out)
out = torch.cat(outs, dim=0)
if dest is None:
out = out.view(-1, pos.shape[0])
After Change
dest = None if dest is None else dest.detach().cpu().to(torch.int).numpy()
pool = mp.Pool(mp.cpu_count())
outs = pool.starmap(
_parallel_loop,
[(pos, face, src, dest, max_distance, norm, i, dtype) for i in range(len(src))]
)
pool.close()
out = torch.cat(outs, dim=0)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 19
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: 17e56b9100275068c7ad0e74c0bf247866da846f
Time: 2020-05-31
Author: j-magnusson@t-online.de
File Name: torch_geometric/utils/geodesic.py
Class Name:
Method Name: geodesic_distance
Project Name: calico/basenji
Commit Name: dc719925f9202a1248d2510aa7aa7e3b648f82cc
Time: 2016-07-14
Author: davidkelley44@gmail.com
File Name: bin/basenji_scent.py
Class Name:
Method Name: main
Project Name: rusty1s/pytorch_geometric
Commit Name: cce4382f73d0976fb94b003949acd668377a0869
Time: 2020-04-03
Author: j-magnusson@t-online.de
File Name: torch_geometric/utils/geodesic.py
Class Name:
Method Name: geodesic_distance