add adapter of HSwish and HSwishGrad for graphengine.

This commit is contained in:
wangshuide2020 2021-11-26 20:18:45 +08:00
parent 6c20f55a51
commit 9a057fce14
3 changed files with 20 additions and 0 deletions

View File

@ -235,6 +235,8 @@ constexpr const char kNamePrelu[] = "PReLU";
constexpr const char kNamePreluGrad[] = "PReLUGrad";
constexpr const char kNameSigmoid[] = "Sigmoid";
constexpr const char kNameSigmoidGrad[] = "SigmoidGrad";
constexpr const char kNameHSwish[] = "HSwish";
constexpr const char kNameHSwishGrad[] = "HSwishGrad";
constexpr const char kNameL2Normalize[] = "L2Normalize";
constexpr const char kNameL2NormalizeGrad[] = "L2NormalizeGrad";
constexpr const char kNameSoftmax[] = "Softmax";

View File

@ -71,6 +71,18 @@ ATTR_MAP(SigmoidGrad) = EMPTY_ATTR_MAP;
OUTPUT_MAP(SigmoidGrad) = {{0, OUTPUT_DESC(z)}};
REG_ADPT_DESC(SigmoidGrad, kNameSigmoidGrad, ADPT_DESC(SigmoidGrad))
// HardSwish
INPUT_MAP(HardSwish) = {{1, INPUT_DESC(x)}};
ATTR_MAP(HardSwish) = EMPTY_ATTR_MAP;
OUTPUT_MAP(HardSwish) = {{0, OUTPUT_DESC(y)}};
REG_ADPT_DESC(HardSwish, kNameHSwish, ADPT_DESC(HardSwish))
// HardSwishGrad
INPUT_MAP(HardSwishGrad) = {{1, INPUT_DESC(grad)}, {2, INPUT_DESC(x)}};
ATTR_MAP(HardSwishGrad) = EMPTY_ATTR_MAP;
OUTPUT_MAP(HardSwishGrad) = {{0, OUTPUT_DESC(y)}};
REG_ADPT_DESC(HardSwishGrad, kNameHSwishGrad, ADPT_DESC(HardSwishGrad))
// Relu6
INPUT_MAP(Relu6) = {{1, INPUT_DESC(x)}};
ATTR_MAP(Relu6) = EMPTY_ATTR_MAP;

View File

@ -89,6 +89,12 @@ DECLARE_OP_USE_OUTPUT(Selu)
DECLARE_OP_ADAPTER(Sigmoid)
DECLARE_OP_USE_OUTPUT(Sigmoid)
DECLARE_OP_ADAPTER(HardSwish)
DECLARE_OP_USE_OUTPUT(HardSwish)
DECLARE_OP_ADAPTER(HardSwishGrad)
DECLARE_OP_USE_OUTPUT(HardSwishGrad)
DECLARE_OP_ADAPTER(SigmoidGrad)
DECLARE_OP_USE_OUTPUT(SigmoidGrad)