File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
torchvision/csrc/ops/quantized/cpu Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,15 @@ void qroi_align_forward_kernel_impl(
23
23
bool aligned,
24
24
const at::Tensor& t_rois,
25
25
T* output) {
26
- const T* input = t_input.contiguous ().data_ptr <T>();
26
+ // Don't delete these otherwise the .data_ptr() data might be undefined
27
+ auto t_input_cont = t_input.contiguous ();
28
+ auto t_rois_cont = t_rois.contiguous ();
29
+
30
+ const T* input = t_input_cont.data_ptr <T>();
27
31
int64_t input_zp = t_input.q_zero_point ();
28
32
float input_scale = t_input.q_scale ();
29
33
30
- const T* rois = t_rois. contiguous () .data_ptr <T>();
34
+ const T* rois = t_rois_cont .data_ptr <T>();
31
35
int64_t rois_zp = t_rois.q_zero_point ();
32
36
float rois_scale = t_rois.q_scale ();
33
37
You can’t perform that action at this time.
0 commit comments