forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'yi3/rebase_1' into yi3/update_to_latest
- Loading branch information
Showing
60 changed files
with
4,442 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//***************************************************************************** | ||
// Copyright 2017-2021 Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//***************************************************************************** | ||
|
||
#include <ngraph/opsets/opset6.hpp> | ||
#include "hard_sigmoid.hpp" | ||
#include <paddlepaddle_frontend/utility.hpp> | ||
|
||
namespace ngraph { | ||
namespace frontend { | ||
namespace pdpd { | ||
namespace op { | ||
|
||
NamedOutputs hard_sigmoid (const NodeContext& node) { | ||
auto data = node.get_ng_input("X"); | ||
auto slope = node.get_attribute<float>("slope"); | ||
PDPD_ASSERT(slope >= 0, "hard_sigmoid: slope must greater than 0!"); | ||
auto alpha = ngraph::opset6::Constant::create(ngraph::element::f32, {}, {slope}); | ||
auto beta = ngraph::opset6::Constant::create(ngraph::element::f32, {}, {node.get_attribute<float>("offset")}); | ||
return node.default_single_output_mapping({std::make_shared<ngraph::opset6::HardSigmoid>(data, alpha, beta)}, {"Out"}); | ||
} | ||
|
||
}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//***************************************************************************** | ||
// Copyright 2017-2021 Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//***************************************************************************** | ||
|
||
#pragma once | ||
#include "node_context.hpp" | ||
|
||
namespace ngraph { | ||
namespace frontend { | ||
namespace pdpd { | ||
namespace op { | ||
|
||
NamedOutputs hard_sigmoid (const NodeContext& node); | ||
|
||
}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//***************************************************************************** | ||
// Copyright 2017-2021 Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//***************************************************************************** | ||
|
||
#include <ngraph/opsets/opset6.hpp> | ||
#include "hard_swish.hpp" | ||
#include <paddlepaddle_frontend/utility.hpp> | ||
|
||
namespace ngraph { | ||
namespace frontend { | ||
namespace pdpd { | ||
namespace op { | ||
|
||
NamedOutputs hard_swish (const NodeContext& node) { | ||
auto data = node.get_ng_input("X"); | ||
if (node.has_attribute<float>("threshold")) { | ||
auto threshold = node.get_attribute<float>("threshold"); | ||
PDPD_ASSERT(std::abs(threshold - 6.0) < 0.001, "hard_swish: threshold must = 6.0."); | ||
} | ||
if (node.has_attribute<float>("scale")) { | ||
auto scale = node.get_attribute<float>("scale"); | ||
PDPD_ASSERT(std::abs(scale - 6.0) < 0.001, "hard_swish: scale must = 6.0."); | ||
} | ||
if (node.has_attribute<float>("offset")) { | ||
auto offset = node.get_attribute<float>("offset"); | ||
PDPD_ASSERT(std::abs(offset - 3.0) < 0.001, "hard_swish: offset must = 3.0."); | ||
} | ||
return node.default_single_output_mapping({std::make_shared<ngraph::opset6::HSwish>(data)}, {"Out"}); | ||
} | ||
|
||
}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//***************************************************************************** | ||
// Copyright 2017-2021 Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//***************************************************************************** | ||
|
||
#pragma once | ||
#include "node_context.hpp" | ||
|
||
namespace ngraph { | ||
namespace frontend { | ||
namespace pdpd { | ||
namespace op { | ||
|
||
NamedOutputs hard_swish (const NodeContext& node); | ||
|
||
}}}} |
Oops, something went wrong.