Python loops execute in the speed of the Python runtime, while Pytorch functions will run in the speed of C when running in the CPU and CUDA speed when a GPU is available.

  • how does C integrate with python?
  • What makes Pytorch fast?
    • C/CUDA integration, offload to GPU
    • what makes GPU great for deep learning

mlai