mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-05 04:17:53 +00:00
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:
parent
fd23b8caad
commit
f352d54743
2 changed files with 567 additions and 388 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue