{
// specifies type of interpolation
// one of `nearest`, `linear`, `linear_onnx`, `cubic` Required.
- InterpolateMode mode;
+ InterpolateMode mode = InterpolateMode::nearest;
// specifies shape calculation mode
// one of `sizes`, `scales` Required
- ShapeCalcMode shape_calculation_mode;
+ ShapeCalcMode shape_calculation_mode = ShapeCalcMode::sizes;
// specify the number of pixels to add to the beginning of the image being
// interpolated. This addition of pixels is done before interpolation
// calculation.
// specifies how to transform the coordinate in the resized tensor to the
// coordinate in the original tensor. one of `half_pixel`, `pytorch_half_pixel`,
// `asymmetric`, `tf_half_pixel_for_nn`, `align_corners`
- CoordinateTransformMode coordinate_transformation_mode;
+ CoordinateTransformMode coordinate_transformation_mode =
+ CoordinateTransformMode::half_pixel;
// specifies round mode when `mode == nearest` and is used only when `mode ==
// nearest`. one of `round_prefer_floor`, `round_prefer_ceil`, `floor`, `ceil`,
// `simple`
- NearestMode nearest_mode;
+ NearestMode nearest_mode = NearestMode::round_prefer_floor;
// a flag that specifies whether to perform anti-aliasing. default is `false`
- bool antialias;
+ bool antialias = false;
// specifies the parameter *a* for cubic interpolation (see, e.g.
// [article](https://ieeexplore.ieee.org/document/1163711/)). *cube_coeff* is
// used only when `mode == cubic`
- double cube_coeff;
+ double cube_coeff = -0.75f;
- InterpolateAttrs()
- : coordinate_transformation_mode(CoordinateTransformMode::half_pixel)
- , nearest_mode(NearestMode::round_prefer_floor)
- , antialias(false)
- , cube_coeff(-0.75f)
- {
- }
+ InterpolateAttrs() = default;
InterpolateAttrs(InterpolateMode mode,
ShapeCalcMode shape_calculation_mode,