I am trying to write a extension for pytorch. I find some repos to study. Now I have some problems:

How about the relation between  module and function? I find some examples call function in module,why not only use module to implement?
I find some cuda implement use kernle, and others not. When should I write the cuda kernel files ?