Alternative to #846, stashing the torch.Tensor object inside the pybind ks wrapper class.
I'd have liked to encapsulate this inside declare_tensor_N; this is probably possible but I didn't see an obvious way to do it. Instead, this implementation creates a Tensor_N_Float object as before, but then assigns the Tensor to an attribute of that object. This requires adding py::dynamic_attr() to the pybind class definition.
Alternative to #846, stashing the
torch.Tensor
object inside the pybind ks wrapper class.I'd have liked to encapsulate this inside
declare_tensor_N
; this is probably possible but I didn't see an obvious way to do it. Instead, this implementation creates aTensor_N_Float
object as before, but then assigns theTensor
to an attribute of that object. This requires addingpy::dynamic_attr()
to the pybind class definition.