Unverified Commit 9c31d1d5 authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Fix pointer to contiguous data in quantized roi_align (#3904)

parent 21049e90
...@@ -23,11 +23,15 @@ void qroi_align_forward_kernel_impl( ...@@ -23,11 +23,15 @@ void qroi_align_forward_kernel_impl(
bool aligned, bool aligned,
const at::Tensor& t_rois, const at::Tensor& t_rois,
T* output) { T* output) {
const T* input = t_input.contiguous().data_ptr<T>(); // Don't delete these otherwise the .data_ptr() data might be undefined
auto t_input_cont = t_input.contiguous();
auto t_rois_cont = t_rois.contiguous();
const T* input = t_input_cont.data_ptr<T>();
int64_t input_zp = t_input.q_zero_point(); int64_t input_zp = t_input.q_zero_point();
float input_scale = t_input.q_scale(); float input_scale = t_input.q_scale();
const T* rois = t_rois.contiguous().data_ptr<T>(); const T* rois = t_rois_cont.data_ptr<T>();
int64_t rois_zp = t_rois.q_zero_point(); int64_t rois_zp = t_rois.q_zero_point();
float rois_scale = t_rois.q_scale(); float rois_scale = t_rois.q_scale();
......
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