[IE][VPU]: support new operation CEILING (#3004)
Add new Operation "Ceiling" for VPU Myriad task: -42885
This commit is contained in:
parent
b437387bd5
commit
634109acfa
@ -19,7 +19,7 @@ set(VPU_SUPPORTED_FIRMWARES usb-ma2x8x pcie-ma248x)
|
|||||||
# Default packages
|
# Default packages
|
||||||
#
|
#
|
||||||
|
|
||||||
set(FIRMWARE_PACKAGE_VERSION 1452)
|
set(FIRMWARE_PACKAGE_VERSION 1460)
|
||||||
set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.2")
|
set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.2")
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -159,6 +159,7 @@ public:
|
|||||||
void parseLogicalNot(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
|
void parseLogicalNot(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
|
||||||
void parseGatherND(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
|
void parseGatherND(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
|
||||||
void parseHSwish(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
|
void parseHSwish(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
|
||||||
|
void parseCeiling(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Special layers
|
// Special layers
|
||||||
|
@ -173,6 +173,7 @@ VPU_DECLARE_ENUM(StageType,
|
|||||||
Swish = 135,
|
Swish = 135,
|
||||||
GatherND = 136,
|
GatherND = 136,
|
||||||
HSwish = 137,
|
HSwish = 137,
|
||||||
|
Ceiling = 138,
|
||||||
)
|
)
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -132,6 +132,7 @@ FrontEnd::FrontEnd(StageBuilder::Ptr stageBuilder, const ie::ICore* core)
|
|||||||
{"Activation", LAYER_PARSER(parseActivation)},
|
{"Activation", LAYER_PARSER(parseActivation)},
|
||||||
{"GatherND", LAYER_PARSER(parseGatherND)},
|
{"GatherND", LAYER_PARSER(parseGatherND)},
|
||||||
{"HSwish", LAYER_PARSER(parseHSwish)},
|
{"HSwish", LAYER_PARSER(parseHSwish)},
|
||||||
|
{"Ceiling", LAYER_PARSER(parseCeiling)},
|
||||||
}} {
|
}} {
|
||||||
VPU_THROW_UNLESS(_core != nullptr, "Argument core is null");
|
VPU_THROW_UNLESS(_core != nullptr, "Argument core is null");
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
// Copyright (C) 2020 Intel Corporation
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <vpu/frontend/frontend.hpp>
|
||||||
|
#include <vpu/stages/post_op_stage.hpp>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <memory>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
|
namespace vpu {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class CeilingStage final : public PostOpStage {
|
||||||
|
public:
|
||||||
|
using PostOpStage::PostOpStage;
|
||||||
|
|
||||||
|
private:
|
||||||
|
StagePtr cloneImpl() const override {
|
||||||
|
return std::make_shared<CeilingStage>(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void serializeParamsImpl(BlobSerializer&) const override {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
void FrontEnd::parseCeiling(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const {
|
||||||
|
VPU_THROW_UNLESS(inputs.size() == 1,
|
||||||
|
"Ceiling stage with name {} must have only 1 input, actually provided {} inputs",
|
||||||
|
layer->name, inputs.size());
|
||||||
|
|
||||||
|
VPU_THROW_UNLESS(outputs.size() == 1,
|
||||||
|
"Ceiling stage with name {} must have only 1 output, actually provided {} outputs",
|
||||||
|
layer->name, outputs.size());
|
||||||
|
|
||||||
|
model->addNewStage<CeilingStage>(layer->name, StageType::Ceiling, layer, inputs, outputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace vpu
|
@ -26,6 +26,7 @@ const std::map<ActivationTypes, std::vector<std::vector<float>>> activationTypes
|
|||||||
{SoftPlus, {}},
|
{SoftPlus, {}},
|
||||||
{Swish, {{0.05f}, {0.8f}, {1.0f}, {15.0f}}},
|
{Swish, {{0.05f}, {0.8f}, {1.0f}, {15.0f}}},
|
||||||
{HSwish, {}},
|
{HSwish, {}},
|
||||||
|
{Ceiling, {}},
|
||||||
};
|
};
|
||||||
|
|
||||||
std::map<std::vector<size_t>, std::vector<std::vector<size_t>>> basic = {
|
std::map<std::vector<size_t>, std::vector<std::vector<size_t>>> basic = {
|
||||||
|
@ -84,6 +84,11 @@ InferenceEngine::Blob::Ptr ActivationLayerTest::GenerateInput(const InferenceEng
|
|||||||
data_range = 2;
|
data_range = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ngraph::helpers::ActivationTypes::Ceiling: {
|
||||||
|
data_start_from = -1000;
|
||||||
|
data_range = 2000;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
data_start_from = -10;
|
data_start_from = -10;
|
||||||
data_range = 20;
|
data_range = 20;
|
||||||
|
Loading…
Reference in New Issue
Block a user