fix grad_output uncontiguous (#737)

* fix grad_output uncontiguous

* add comments for uncontiguous
pull/745/head
shilong 2020-12-21 17:21:20 +08:00 committed by GitHub
parent dedd79940e
commit ae982b2806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -94,7 +94,8 @@ class RoIAlignFunction(Function):
def backward(ctx, grad_output):
rois, argmax_y, argmax_x = ctx.saved_tensors
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(
grad_output,
rois,