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.
- Parameters
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.
- Parameters
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.
- Parameters
method – [in] Define the mode of resizing.
-
void set_new_height(const int64_t new_height)
Method to set new_height attribute.
- Parameters
new_height – [in] Define the height of the output.
-
void set_new_width(const int64_t new_width)
Method to set new_width attribute.
- Parameters
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.
- Parameters
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.
- Parameters
coordinate_transform_mode – [in] Define the rule to map coordinate.
-
void set_cubic_coeff(const float cubic_coeff)
Method to set cubic_coeff attribute.
- Parameters
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.
- Parameters
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.
- Parameters
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.
- Parameters
nearest_mode – [in] Define the rule how to get nearest pixel.
-
Format get_format() const
Method to get format attribute.
- Returns
the format of the input.
-
ResizeMethod get_method() const
Method to get method attribute.
- Returns
the mode of resizing.
-
int64_t get_new_height() const
Method to get new_height attribute.
- Returns
the height of the output.
-
int64_t get_new_width() const
Method to get new_width attribute.
- Returns
the width of the output.
-
bool get_preserve_aspect_ratio() const
Method to get preserve_aspect_ratio attribute.
- Returns
a boolean value.
-
CoordinateTransformMode get_coordinate_transform_mode() const
Method to get coordinate_transform_mode attribute.
- Returns
the rule to map coordinate
-
float get_cubic_coeff() const
Method to get cubic_coeff attribute.
- Returns
a coefficient used in cubic interpolation
-
int64_t get_exclude_outside() const
Method to get exclude_outside attribute.
- Returns
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.
- Returns
a value used to fill the outside of original area if possible
-
NearestMode get_nearest_mode() const
Method to get nearest_mode attribute.
- Returns
the rule to get nearest pixel.
-
inline Resize()