GDB debug "torch::add" op, why breakpoint 'at::native::Add' not hit

Steps:

  1. I use Pytorch’s DEBUG build
  2. I debug this python program in clion IDE, and breakpoint at ‘b = torch.rand([10,20])’
import torch

if __name__ == "__main__":
  a = torch.rand([10,20])
  b = torch.rand([10,20])
  c = a + b
  print(c) 
  1. I attach GDB to this program
  2. in gdb, b at::native::Add
  3. continue gdb debugger
  4. continue python debugger

but at::native::Add cannot be hit, I want to know why and how to solve it (letting me debug the actual cpu kernel)

only at::Add can be hit, but after hitting it, it will dispatch the op, and I cannot step into some op impl like at::native::Add