Hi, I’m working on getting tvm integrated into some pytorch layers. To do this, I need to wrap a pytorch tensor as a DLpack. Fortunately, pytorch supports this using torch._C._to_dlpack(). However, this returns a PyCapsule object. I need to be able to point tvm to the data attribute of the DLTensor, but pytorch cannot access any attributes of a PyCapsule. Am I doing something wrong or is _to_dlpack only meant to be an intermediate between c function calls?
Yup, it works pretty well! Here’s the code I use to make it work. Basically, a FireTensor is a TVM compatible object that operates directly on a PyTorch Tensor.