#ifndef RES_NUMS_H_
#define RES_NUMS_H_
#include "tensorOperate.h"
#include "resUnitLayer.h"
#include "convLayer.h"

class ResNLayer : public TensorOperate
{
    public:        
        ResNLayer();
        ResNLayer(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, int resNum, int kerNum, \
                  float initGamma, float initBeta, float iLambda, float iAlpha, float lb, float ld, int ls, const char *inFunTypeStr);                                    
        virtual ~ResNLayer(); 
        
        void ComputeAndCreateOutYInDTensorInfo();
        void UpdateWeightMain();
        void SaveLayerWeight(int n);
        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 SetLayerConfig(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, int resNum, int kerNum, \
                            float initGamma, float initBeta, float iLambda, float iAlpha, float lb, float ld, int ls, const char *inFunTypeStr);
        void CreateSelfNet();
        void RealeaseSubLayesInstance();
        
        CBAGroupLayer *mCBALayer;
        ResUnitLayer *mResUnitLayer;        
        int mResNum;
        int mKerNum;
        float mInitGamma; 
        float mInitBeta;
        float mLambda; 
        float mAlpha;
        float mLb;
        float mLd; 
        int mLs;
        char mAcType[16];
        int inChannels, inHeight, inWidth;
        int outChannels, outHeight, outWidth;
};

#endif