Closed im0qianqian closed 2 years ago
Use torch.diagonal replaces the original loop operation, which can greatly improve the backward speed of the model, especially on large-scale graphs.
torch.diagonal
Experiment (for reference only)
Number of nodes: 19942 Number of edges: 27045268
Execution time of the original loop operation: 12.43s/it Execution time of the torch.diagonal: 23.87it/s (297x ↑)
Thanks for your contribution!
Use
torch.diagonal
replaces the original loop operation, which can greatly improve the backward speed of the model, especially on large-scale graphs.Experiment (for reference only)
Number of nodes: 19942 Number of edges: 27045268
Execution time of the original loop operation: 12.43s/it Execution time of the
torch.diagonal
: 23.87it/s (297x ↑)