pytorch / extension-ffi

Examples of C extensions for PyTorch
258 stars 70 forks source link

How to pass a struct from pytorch to c extension? #15

Open chenchr opened 6 years ago

chenchr commented 6 years ago

Hello. Thanks for sharing the example. However, I am writing a extension that need many parameters, I think pass the parameters as c struct should be a method to make the code more readable, are there any example to deal with extension has too much parameters to pass? Besides, how can I generate random number in THc? Are there a api doc? Thanks!