#ifndef CBA_GROUP_H_
#define CBA_GROUP_H_
#include "tensorOperate.h"
#include "convLayer.h"
#include "batchNormLayer.h"
#include "activeLayer.h"

class CBAGroupLayer : public TensorOperate
{
    public:
        CBAGroupLayer(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, const char *cTS, \
                      int iPad, int iStd, int iDia, int iStdPad, int kNum, int inKSize, float initGamma, float initBeta, \
                      float iLambda, float iAlpha, float lb, float ld, int ls, const char* inFunTypeStr);
        virtual ~CBAGroupLayer();
        void ComputeAndCreateOutYInDTensorInfo();
        void CompuateOutY(int devID, int seqNum);
        void CompuateOutD(int devID, int seqNum);
        void SaveLayerWeight(int n);
        void UpdateWeightMain();
        void LoadLayerWeight();
        void ComputerYMemRealease(int devID);
        void ComputerDMemRealease(int devID);
        void CreateParaAndInstance();

    private:
        void RealeaseSubLayesInstance(); 
        ConvLayer *mConvLayer;
        BatchNormLayer *mBatchNormLayer;
        ActiveLayer *mActiveLayer;
        int mKernelSize;
        int inChannels, inHeight, inWidth;
        int outChannels, outHeight, outWidth;
};

#endif