-
Notifications
You must be signed in to change notification settings - Fork 27.4k
torch::autograd::Function should set AutoNonVariableTypeMode when running forward #40736
Copy link
Copy link
Open
Labels
module: autogradRelated to torch.autograd, and the autograd engine in generalRelated to torch.autograd, and the autograd engine in generaltriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
Currently, it does not, which means you cannot write idiomatic redispatch as:
static torch::autograd::variable_list forward(
torch::autograd::AutogradContext* ctx,
torch::autograd::Variable input,
torch::autograd::Variable rois,
...) {
ctx->saved_data["spatial_scale"] = spatial_scale;
...
// at::AutoNonVariableTypeMode g;
auto result = roi_align(
input,
rois,
...
You have to add the AutoNonVariableTypeMode guard yourself. This should have been taken care of in Function.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
module: autogradRelated to torch.autograd, and the autograd engine in generalRelated to torch.autograd, and the autograd engine in generaltriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module