API to query whether a field needs gradients #5274
Labels
autodiff
This issue is related to automatic differentiation system
feature request
Suggest an idea on this project
Concisely describe the proposed feature
I would like to request an API to query whether a field needs gradients.
Describe the solution you'd like (if any)
An attribute or property attached to a field object, which states whether a field needs gradients in backward-mode differentiation.
Additional comments
This feature request dates back to #2498 whose conversation was in the old Slack community channel. In my use case, I need it to check whether a field passed by the user of my library
stannum
needs gradients or not, and based on that my library creates different tensors. Besides my use case, it is a common need to check if a field needs gradients or not.The text was updated successfully, but these errors were encountered: