Class Resize
Defined in File resize.h
Inheritance Relationships
Base Type
public mindspore::ops::BaseOperator
Class Documentation
-
class Resize : public mindspore::ops::BaseOperator
Resize defined the Resize operator prototype of lite.
Public Functions
-
inline Resize()
Constructor.
-
void Init(const Format format, const ResizeMethod method, const int64_t new_height, const int64_t new_width, const bool preserve_aspect_ratio, const CoordinateTransformMode coordinate_transform_mode, const float cubic_coeff, const int64_t exclude_outside, const float extrapolation_value, const NearestMode nearest_mode)
Method to init the op's attributes.
- 参数
format – [in] Define the format of the input, which only support NHWC on lite.
method – [in] Define the mode of resizing.
new_height – [in] Define the height of the output.
new_width – [in] Define the width of the output.
preserve_aspect_ratio – [in] Define a boolean to indicate keep the aspect radio with the input. Default is false.
coordinate_transform_mode – [in] Define the rule to map coordinate.
cubic_coeff – [in] Define a coefficient only used in cubic interpolation.
exclude_outside – [in] Define a value to indicate whether to set the outside of the sampling area as 0. If the value is 1, the outside area will be set as 0. Default is 0.
extrapolation_value – [in] Define a value that will be used to fill the outside of original area if possible.
nearest_mode – [in] Define the rule how to get nearest pixel.
-
void set_format(const Format format)
Method to set format attribute.
- 参数
format – [in] Define the format of the input, which only support NHWC on lite.
-
void set_method(const ResizeMethod method)
Method to set method attribute.
- 参数
method – [in] Define the mode of resizing.
-
void set_new_height(const int64_t new_height)
Method to set new_height attribute.
- 参数
new_height – [in] Define the height of the output.
-
void set_new_width(const int64_t new_width)
Method to set new_width attribute.
- 参数
new_width – [in] Define the width of the output.
-
void set_preserve_aspect_ratio(const bool preserve_aspect_ratio)
Method to set preserve_aspect_ratio attribute.
- 参数
preserve_aspect_ratio – [in] Define a boolean to indicate keep the aspect radio with the input. Default is false.
-
void set_coordinate_transform_mode(const CoordinateTransformMode coordinate_transform_mode)
Method to set coordinate_transform_mode attribute.
- 参数
coordinate_transform_mode – [in] Define the rule to map coordinate.
-
void set_cubic_coeff(const float cubic_coeff)
Method to set cubic_coeff attribute.
- 参数
cubic_coeff – [in] Define a coefficient only used in cubic interpolation.
-
void set_exclude_outside(const int64_t exclude_outside)
Method to set exclude_outside attribute.
- 参数
exclude_outside – [in] Define a value to indicate whether to set the outside of the sampling area as 0. If the value is 1, the outside area will be set as 0. Default is 0.
-
void set_extrapolation_value(const float extrapolation_value)
Method to set extrapolation_value attribute.
- 参数
extrapolation_value – [in] Define a value that will be used to fill the outside of original area if possible.
-
void set_nearest_mode(const NearestMode nearest_mode)
Method to set nearest_mode attribute.
- 参数
nearest_mode – [in] Define the rule how to get nearest pixel.
-
ResizeMethod get_method() const
Method to get method attribute.
- 返回
the mode of resizing.
-
int64_t get_new_height() const
Method to get new_height attribute.
- 返回
the height of the output.
-
int64_t get_new_width() const
Method to get new_width attribute.
- 返回
the width of the output.
-
bool get_preserve_aspect_ratio() const
Method to get preserve_aspect_ratio attribute.
- 返回
a boolean value.
-
CoordinateTransformMode get_coordinate_transform_mode() const
Method to get coordinate_transform_mode attribute.
- 返回
the rule to map coordinate
-
float get_cubic_coeff() const
Method to get cubic_coeff attribute.
- 返回
a coefficient used in cubic interpolation
-
int64_t get_exclude_outside() const
Method to get exclude_outside attribute.
- 返回
a value to indicate whether to set the outside of the sampling area as 0.
-
float get_extrapolation_value() const
Method to get extrapolation_value attribute.
- 返回
a value used to fill the outside of original area if possible
-
NearestMode get_nearest_mode() const
Method to get nearest_mode attribute.
- 返回
the rule to get nearest pixel.
-
inline Resize()