Refactor Resize/Upsample implementation to reduce binary size. (#7650)

* Refactor Resize/Upsample to split type agnostic code out from templatized code.

Saving is ~17KB for a Windows Release build.
This commit is contained in:
Scott McKay 2021-06-07 15:48:06 +10:00 committed by GitHub
parent fd23b8caad
commit f352d54743
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 567 additions and 388 deletions

File diff suppressed because it is too large Load diff

View file

@ -66,10 +66,13 @@ class UpsampleBase {
extrapolation_value_ = info.GetAttrOrDefault<float>("extrapolation_value", 0.0f);
// Coordinate transformation mode attr was introduced in version 11, before that asymmetric mode was the only available transformation mode
std::string coordinate_transform_mode_name = opset > 10
? info.GetAttrOrDefault<std::string>("coordinate_transformation_mode", "half_pixel")
: "asymmetric";
// Coordinate transformation mode attr was introduced in version 11.
// before that asymmetric mode was the only available transformation mode
std::string coordinate_transform_mode_name =
opset > 10
? info.GetAttrOrDefault<std::string>("coordinate_transformation_mode", "half_pixel")
: "asymmetric";
coordinate_transform_mode_ = StringToCoordinateTransformationMode(coordinate_transform_mode_name);
if (opset >= 13 && coordinate_transform_mode_ == TF_HALF_PIXEL_FOR_NN) {
LOGS_DEFAULT(WARNING)