I am wondering if there are documents about pytorch Tensor c/c++ API functions such as
THTensor_(select), or header files with short comments about the usage / functionality of these funtions.
I am writing some c/c++ code to extend Pytorch but do not know how to use these c/c++ API. For example, does
THTensor_(newSelect) return a shallow or deep copy of the input tensor? What about
We dont have specific docs as of yet. We are preparing some documentation for extensions soon.
HI, @smth Thanks for your reply.
I want to get a subtensor from the input Tensor, like input[:, 2, :, :] or input[:, 2:3, 2:3, :] as a continous deep copy, is there any Tensor API to do that? Or I will need to copy the memory manualy?
Select and narrow return views. Call clone afterwards to make a copy.
Thanks~ got it.
Looking forward to the docs for the extensions.