(args, path_list)
| 25 | yield list[i:i + n] |
| 26 | |
| 27 | def build_graph(args, path_list): |
| 28 | for path in path_list: |
| 29 | name = os.path.basename(path) |
| 30 | net_edges = np.load(os.path.join(args.data_path, 'net_edges', name))['net_edges'] |
| 31 | nodes = np.load(os.path.join(args.data_path, 'nodes', name))['nodes'] |
| 32 | pin_positions = np.load(os.path.join(args.data_path, 'pin_positions', name), allow_pickle=True)['pin_positions'].item() |
| 33 | g = dgl.heterograph({ |
| 34 | ('node', 'net_out', 'node'): (net_edges[:,0], net_edges[:,1]), |
| 35 | ('node', 'net_in', 'node'): (net_edges[:,1], net_edges[:,0]), |
| 36 | }) |
| 37 | |
| 38 | g.edges['net_out'].data['net_delay'] = torch.tensor(net_edges[:,2:]).type(torch.float32) |
| 39 | g.ndata['nf'] = torch.tensor([pin_positions[nodes[i.item()].replace('\\','')][0:4] for i in g.nodes()]).type(torch.float32) |
| 40 | dgl.save_graphs('{}/{}.bin'.format(args.save_path, name), g) |
| 41 | |
| 42 | |
| 43 | def parse_args(): |
nothing calls this directly
no outgoing calls
no test coverage detected