torch.matmul在哪里实施?

Where is torch.matmul implemented?

torch.matmul在哪里实现的,特别是在GPU上运行的部分?

整个项目2M行代码。我试图 grep 1.8.2 版本的来源,但找不到此功能。我猜它是由某种东西生成的...

我相信您正在寻找的是 this file

应该实现如下: https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/LinearAlgebra.cpp#L1450

包含的matmul函数被Functions.h and ATen.h包含Functions.h 在 pytorch api(pytorch/torch/csrc/api/include/torch/linalg.h) 中,它包括 <ATen/ATen.h>

所以:

pytorch/torch/csrc/api/include/torch/linalg.h > ATen > 函数 > 线性代数 > matmul