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

class LinearLayer : public TensorOperate
{
    public:
        LinearLayer();
        LinearLayer(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach);
        LinearLayer(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, float wCoff, float bias);
        void SetLayerConfig(int ifType, int iID, int iMaxSeqNum, DevicesBatchDisptach *iDevicesBatchDisptach, float wCoff, float bias);
        void UpdateFactor(float wCoff, float bias);
        virtual ~LinearLayer();
        void ComputeAndCreateOutYInDTensorInfo();
        void CreateParaAndInstance();
        void CompuateOutY(int devID, int seqNum);
        void CompuateOutD(int devID, int seqNum);

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

    private:
        void SetYDSaveInfo();
        float mWCoff, mBias;
        int outputNum;
};

#endif
