//
//  MNN.fbs
//  MNN
//
//  Created by MNN on 2019/1/4.
//  Copyright © 2018, Alibaba Group Holding Limited
//
include "Tensor.fbs";
include "Type.fbs";
//include "TFQuantizeOp.fbs";
namespace MNN;

table Conv2dSuperAcmeQuantizedParam {
    
    mquantizeMultiplier:[int];
    mRightShift:[int];
    mintbias:[int];
    mmode:int=0;
    weightType:DataType = DT_INT8;
}

table EltwiseSuperAcmeQuantizedParam {
    // useless, just for debug
    //activationType: FusedActivation;

    input1Offset:int=0;
    input2Offset:int=0;
    outputOffset:int=0;

    input1Multiplier:int=0;
    input2Multiplier:int=0;
    outputMultiplier:int=0;

    outputActivationMin:int=0;
    outputActivationMax:int=0;

    mLeftShiftResult1:int=0;
    mLeftShiftResult2:int=0;

    mRightShift1:int=0;
    mRightShift2:int=0;

    mLeftShiftOut:int=0;
    mRightShiftOut:int=0;
    mode:int=0;
}

table PoolingSuperAcmeQuantizedParam {
    // useless, just for debug
    //activationType: FusedActivation;

    needscale:bool=true;
    inputOffset:int;
    outputOffset:int;
    outputMultiplier:int;
    outputShift:int;
}

table ReluSuperAcmeQuantizedParam {

    inputZero:int;
    outputZero:int;
    inputScale:int;
    outputScale:int;
}

table PReluSuperAcmeQuantizedParam {

    inputZero:int;
    outputZero:int;
    //inputScale:int;
    //outputScale:int;

    slope_q:[int];
    mRightShiftQ:[int];
    mRightShiftQ_:int;

    slope_p:[int];//positive
    mRightShiftP:[int];
    mRightShiftP_:int;

    mintbiasQ:[int];
    mintbiasP:[int];

    outputActivationMin:int=0;
    outputActivationMax:int=0;
}
table LutSuperAcmeQuantizedParam {
    lutFlag:bool;
    lutTbl:[byte];
    inputZero:int;
    outputZero:int;
    inputScale:double;
    outputScale:double;
}

table InterpSuperAcmeQuantizedParam {
    mode:int=0;
    // offline prepare positions and factor
    xPositions:[int];
    yPositions:[int];
    xFactors:[int];
    yFactors:[int];
    // aligned for xFactor and yFactor
    unifiedFactorShift:int=0;
    clampMin: byte = -128;
    clampMax: byte = 127;
}

table BinarySuperAcmeQuantizedParam {
    input1Offset:int=0;
    input2Offset:int=0;
    outputOffset:int=0;

    input1Multiplier:int=0;
    input2Multiplier:int=0;
    outputMultiplier:int=0;

    outputActivationMin:int=0;
    outputActivationMax:int=0;

    mLeftShiftResult1:int=0;
    mLeftShiftResult2:int=0;

    mRightShift1:int=0;
    mRightShift2:int=0;

    mLeftShiftOut:int=0;
    mRightShiftOut:int=0;
    type:int=0;
}

table ScaleSuperAcmeQuantizedParam {
    mRightShift:int = 0;
    mquantizeMultiplier:[int];    
    mintbias:[int];
    outputActivationMin:int=0;
    outputActivationMax:int=0;
}

table MatMulSuperAcmeQuantizedParam {
    mquantizeMultiplier:int=0;
    mRightShift:int=0;
    outputActivationMin:int=0;
    outputActivationMax:int=0;
    input1Offset:int=0;
    input2Offset:int=0;
    outputOffset:int=0;
    mOffsetSum:int=0;
    mBiasquantizeMultiplier:int=0;
    mBiasShift:int=0;
}

table ArgMaxSuperAcmeQuantizedParam {
    mouttype:int = 0;
    mscale:float=0.0;
    mzero:int=0;
}

table ReductionSuperAcmeQuantizedParam {
    inputZeroPoint:int=0;
    mquantizeMultiplier:int=0;
    mRightShift:int=0;
    outputActivationMin:int=0;
    outputActivationMax:int=0;
    outputOffset:int=0;
}

table Relu6SuperAcmeQuantizedParam {
    thresMin:int=0;
    thresMax:int=0;
}