def METHOD_NAME(
    ctx: Any, grad_output: torch.Tensor
) -> Tuple[Optional[torch.Tensor], Optional[torch.Tensor], None, None,
           None, None, None]:
    feature_size = ctx.feature_size
    rois = ctx.saved_tensors[0]
    assert feature_size is not None
    batch_size, num_channels, data_height, data_width = feature_size
    out_w = grad_output.size(3)
    out_h = grad_output.size(2)
    grad_input = grad_rois = None
    if ctx.needs_input_grad[0]:
        grad_input = rois.new_zeros(batch_size, num_channels, data_height,
                                    data_width)
        ext_module.roi_align_rotated_backward(
            grad_output.contiguous(),
            rois,
            grad_input,
            pooled_height=out_h,
            pooled_width=out_w,
            spatial_scale=ctx.spatial_scale,
            sampling_ratio=ctx.sampling_ratio,
            aligned=ctx.aligned,
            clockwise=ctx.clockwise)
    return grad_input, grad_rois, None, None, None, None, None