File tree Expand file tree Collapse file tree 3 files changed +30
-24
lines changed
torchvision/csrc/ops/autograd Expand file tree Collapse file tree 3 files changed +30
-24
lines changed Original file line number Diff line number Diff line change 33#include < torch/autograd.h>
44#include < torch/types.h>
55
6+ #include < utility>
7+
68namespace vision {
79namespace ops {
810
@@ -15,8 +17,8 @@ class PSROIPoolFunction : public torch::autograd::Function<PSROIPoolFunction> {
1517 const torch::autograd::Variable& input,
1618 const torch::autograd::Variable& rois,
1719 double spatial_scale,
18- c10::SymInt pooled_height,
19- c10::SymInt pooled_width) {
20+ const c10::SymInt& pooled_height,
21+ const c10::SymInt& pooled_width) {
2022 ctx->saved_data [" spatial_scale" ] = spatial_scale;
2123 ctx->saved_data [" pooled_height" ] = pooled_height;
2224 ctx->saved_data [" pooled_width" ] = pooled_width;
@@ -84,12 +86,12 @@ class PSROIPoolBackwardFunction
8486 rois,
8587 channel_mapping,
8688 spatial_scale,
87- pooled_height,
88- pooled_width,
89- batch_size,
90- channels,
91- height,
92- width);
89+ std::move ( pooled_height) ,
90+ std::move ( pooled_width) ,
91+ std::move ( batch_size) ,
92+ std::move ( channels) ,
93+ std::move ( height) ,
94+ std::move ( width) );
9395
9496 return {grad_in};
9597 }
Original file line number Diff line number Diff line change 33#include < torch/autograd.h>
44#include < torch/types.h>
55
6+ #include < utility>
7+
68namespace vision {
79namespace ops {
810
@@ -15,8 +17,8 @@ class ROIAlignFunction : public torch::autograd::Function<ROIAlignFunction> {
1517 const torch::autograd::Variable& input,
1618 const torch::autograd::Variable& rois,
1719 double spatial_scale,
18- c10::SymInt pooled_height,
19- c10::SymInt pooled_width,
20+ const c10::SymInt& pooled_height,
21+ const c10::SymInt& pooled_width,
2022 int64_t sampling_ratio,
2123 bool aligned) {
2224 ctx->saved_data [" spatial_scale" ] = spatial_scale;
@@ -90,12 +92,12 @@ class ROIAlignBackwardFunction
9092 grad,
9193 rois,
9294 spatial_scale,
93- pooled_height,
94- pooled_width,
95- batch_size,
96- channels,
97- height,
98- width,
95+ std::move ( pooled_height) ,
96+ std::move ( pooled_width) ,
97+ std::move ( batch_size) ,
98+ std::move ( channels) ,
99+ std::move ( height) ,
100+ std::move ( width) ,
99101 sampling_ratio,
100102 aligned);
101103 return {result};
Original file line number Diff line number Diff line change 33#include < torch/autograd.h>
44#include < torch/types.h>
55
6+ #include < utility>
7+
68namespace vision {
79namespace ops {
810
@@ -15,8 +17,8 @@ class ROIPoolFunction : public torch::autograd::Function<ROIPoolFunction> {
1517 const torch::autograd::Variable& input,
1618 const torch::autograd::Variable& rois,
1719 double spatial_scale,
18- c10::SymInt pooled_height,
19- c10::SymInt pooled_width) {
20+ const c10::SymInt& pooled_height,
21+ const c10::SymInt& pooled_width) {
2022 ctx->saved_data [" spatial_scale" ] = spatial_scale;
2123 ctx->saved_data [" pooled_height" ] = pooled_height;
2224 ctx->saved_data [" pooled_width" ] = pooled_width;
@@ -84,12 +86,12 @@ class ROIPoolBackwardFunction
8486 rois,
8587 argmax,
8688 spatial_scale,
87- pooled_height,
88- pooled_width,
89- batch_size,
90- channels,
91- height,
92- width);
89+ std::move ( pooled_height) ,
90+ std::move ( pooled_width) ,
91+ std::move ( batch_size) ,
92+ std::move ( channels) ,
93+ std::move ( height) ,
94+ std::move ( width) );
9395
9496 return {grad_in};
9597 }
You can’t perform that action at this time.
0 commit comments