RoiAlign CPU EP add warning for max mode with samples != 1 (#12136)

* RoiAlign add warning about incorrect max summation when sample size not 1
This commit is contained in:
Dwayne Robinson 2022-07-11 17:44:41 -07:00 committed by GitHub
parent f1047e0456
commit 742f843efc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,7 +29,6 @@ class RoiAlignBase {
} else {
ORT_THROW("Invalid mode of value ", mode, " specified. It should be either avg or max");
}
mode_ = mode == "avg" ? RoiAlignMode::avg : RoiAlignMode::max;
}
// output_height
@ -64,6 +63,13 @@ class RoiAlignBase {
else
half_pixel_ = false;
}
if (mode_ == RoiAlignMode::max && sampling_ratio_ != 1) {
// TODO(fdwr): Issue #6146. ORT 1.13 will correct the incorrect summation of max mode with PR #7354.
LOGS_DEFAULT(WARNING) << "The existing summation for max mode and sampling ratios besides 1 is incorrect "
<< "and will be fixed in the next ORT 1.13 release. Thus the results of RoiAlign "
<< "will be different.";
}
}
protected: