Tensorflow’s py_function wraps a python function into a TensorFlow op and allows autograd through the graph. Is there an equivalent function in Pytorch - where a numpy tensor is passed into an arbitrary function and wrapped as a Pytorch op.
Thanks.