Unverified Commit ae982b28 authored by shilong's avatar shilong Committed by GitHub
Browse files

fix grad_output uncontiguous (#737)

* fix grad_output uncontiguous

* add comments for uncontiguous
parent dedd7994
...@@ -94,7 +94,8 @@ class RoIAlignFunction(Function): ...@@ -94,7 +94,8 @@ class RoIAlignFunction(Function):
def backward(ctx, grad_output): def backward(ctx, grad_output):
rois, argmax_y, argmax_x = ctx.saved_tensors rois, argmax_y, argmax_x = ctx.saved_tensors
grad_input = grad_output.new_zeros(ctx.input_shape) grad_input = grad_output.new_zeros(ctx.input_shape)
# complex head architecture may cause grad_output uncontiguous.
grad_output = grad_output.contiguous()
ext_module.roi_align_backward( ext_module.roi_align_backward(
grad_output, grad_output,
rois, rois,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment