tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

requires_grad=True for an input datapoint?

Open ggbioing opened this issue 1 year ago • 1 comments

https://github.com/pytorch/tutorials/blob/f4ebb4d007792f5bc302affa7b360a9710e4a88b/advanced_source/super_resolution_with_onnxruntime.py#L144

It is obscure to me why there is the need to set the flag requires_grad to True for datapoint "x", which has no parameters to be learnt. Is it something required to export the model in onnx?

Thanks.

cc @BowenBao

ggbioing avatar May 08 '24 15:05 ggbioing

cc: @thiagocrepaldi

svekars avatar May 08 '24 15:05 svekars

For a faster answer, please post in https://discuss.pytorch.org/

svekars avatar Apr 16 '25 20:04 svekars

Thanks, we should redo this tutorial.

justinchuby avatar Apr 16 '25 21:04 justinchuby