#ifndef BTNK1_LAYER_H_
#define BTNK1_LAYER_H_
#include "tensorOperate.h"
#include "convLayer.h"
#include "batchNormLayer.h"
#include "activeLayer.h"
#include "fusionLayer.h"

class BTNK1GroupLayer : public TensorOperate
{
    public:
        BTNK1GroupLayer(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, int c1, int s, float iLambda, \
                        float iAlpha, float initGamma, float initBeta, float lb, float ld, int ls, const char *inFunTypeStr);
        virtual ~BTNK1GroupLayer();
        void ComputeAndCreateOutYInDTensorInfo();
        void SaveLayerWeight(int n);
        void UpdateWeightMain();
        void LoadLayerWeight();
        void ComputerYMemRealease(int devID);
        void ComputerDMemRealease(int devID);
        void CreateParaAndInstance();
        void CompuateOutY(int devID, int seqNum);
        void CompuateOutD(int devID, int seqNum);

    private:              
        void RealeaseSubLayesInstance();
        
        ConvLayer *mConvLayer1;
        BatchNormLayer *mBatchNormLayer1;
        ActiveLayer *mActiveLayer1;
    
        ConvLayer *mConvLayer2;
        BatchNormLayer *mBatchNormLayer2;
        ActiveLayer *mActiveLayer2;
    
        ConvLayer *mConvLayer3;
        BatchNormLayer *mBatchNormLayer3;
        
        ConvLayer *mConvLayer4;
        BatchNormLayer *mBatchNormLayer4;
        
        FusionLayer *mFusionLayer;
    
        ActiveLayer *mActiveLayer;
                
        int inChannels, inHeight, inWidth;
        int outChannels, outHeight, outWidth;
        
        int mC1, mS;
};

#endif
