extension-ffi
extension-ffi copied to clipboard
C extension API
hello,where can i get the APIs of pytorch C extension function,such as THFloatTensor_resizeAs, THFloatTensor_add. Except those,has any function else? Thx.
#include <TH/TH.h>
Thanks you , but where can I find that file? @taineleau
in pytorch source code https://github.com/pytorch/pytorch/tree/502aaf39cf4a878f9e4f849e5f409573aa598aa9/aten/src
When I compile in c++, the error: THFloatTensor_cadd is undefined `#include <TH/TH.h>
int my_lib_add_forward(THFloatTensor *input1, THFloatTensor *input2, THFloatTensor *output) { if (!THFloatTensor_isSameSizeAs(input1, input2)) return 0; THFloatTensor_resizeAs(output, input1); THFloatTensor_cadd(output, input1, 1.0, input2); return 1; }
int my_lib_add_backward(THFloatTensor *grad_output, THFloatTensor *grad_input) { THFloatTensor_resizeAs(grad_input, grad_output); THFloatTensor_fill(grad_input, 1); return 1; }` i use pytorch0.4.1
@lxtGH ,HI When I compile in c++, print the error: THFloatTensor_cadd is undefined. could give me some adavice.