#ifndef LCF_AVEPOOL_H_
#define LCF_AVEPOOL_H_
#include "tensorOperate.h"

// average sample
class AvePoolLayer : public TensorOperate
{
    public:
        AvePoolLayer(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, \
                     const char *inTypeStr, int kSize, int rtPad, int rbPad, int clPad, int crPad);
        virtual ~AvePoolLayer();
        void ComputeAndCreateOutYInDTensorInfo();

        void SaveLayerWeight(int n);
        void LoadLayerWeight();
        int GetThisLayerNeedCMem();

        void CompuateOutY(int devID, int seqNum);
        void CompuateOutD(int devID, int seqNum);

        void ComputerYMemRealease(int devID);
        void ComputerDMemRealease(int devID);
        void CreateParaAndInstance();

    private:
        int kernelSize;                       // sample kernel
        int pType;                            // sample type: upsample downsample
        int mrtPad, mrbPad, mclPad, mcrPad;   // PAD
        int inChannels, inHeight, inWidth;
        int outChannels, outHeight, outWidth;
};

#endif
