Class AvgPoolFusion

Inheritance Relationships

Base Type

  • public mindspore::ops::BaseOperator

Class Documentation

class AvgPoolFusion : public mindspore::ops::BaseOperator

AvgPoolFusion defined AvgPool operator prototype of lite.

Public Functions

inline AvgPoolFusion()

Constructor.

void Init(const std::vector<int64_t> &kernel_size = {1}, const std::vector<int64_t> &stride = {1}, const PadMode &pad_mode = VALID, const Format &format = NCHW, const std::vector<int64_t> &pad = {0, 0, 0, 0}, const RoundMode &round_mode = RoundMode::FLOOR, const bool global = false, const ActivationType activation_type = NO_ACTIVATION)

Method to init the op's attributes.

Parameters
  • kernel_size[in] Define the size of the kernel.

  • stride[in] Define the moving size of the kernel.

  • pad_mode[in] Define the padding method.

  • format[in] Define the format of input tensor.

  • pad[in] Define the concrete padding value on each dimension

  • round_mode[in] Define numerical operation mode of the output tensor.

  • global[in] Define a boolean value to indicate whether to do global pooling. If true, kernel_size will be useless.

  • activation_type[in] Define the activation type.

void set_pad_mode(const int64_t &pad_mode)

Set pad_mode.

void set_kernel_size(const std::vector<int64_t> &kernel_size)

Set kernel_size.

void set_strides(const std::vector<int64_t> &strides)

Set strides.

void set_data_format(const int64_t &data_format)

Set format.

void set_pad(const std::vector<int64_t> &pad)

Set pad.

void set_round_mode(const int64_t &round_mode)

Set round_mode.

std::vector<int64_t> get_kernel_size() const

Get kernel_size.

Returns

kernel_size.

std::vector<int64_t> get_strides() const

Get strides.

Returns

strides.

int64_t get_pad_mode() const

Get pad_mode.

Returns

pad_mode.

int64_t get_data_format() const

Get format.

Returns

format.

std::vector<int64_t> get_pad() const

Get pad.

Returns

pad.

int64_t get_round_mode() const

Get round_mode.

Returns

round_mode.

void set_global(const bool global)

Method to set global attribute.

Parameters

global[in] Define a boolean value to indicate whether to do global pooling. If true, kernel_size will be useless.

void set_activation_type(const ActivationType activation_type)

Method to set activation type.

Parameters

activation_type[in] Define the activation type.

bool get_global() const

Method to get global attribute.

Returns

a boolean value to indicate whether to do global pooling. If true, kernel_size will be useless.

ActivationType get_activation_type() const

Method to get activation type.

Returns

activation type.