-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
256 additions
and
49 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...on/low_precision_transformations/include/low_precision/rt_info/skip_cleanup_attribute.hpp
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,34 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include <set> | ||
#include <unordered_set> | ||
#include <vector> | ||
|
||
#include <ngraph/node.hpp> | ||
#include <ngraph/pass/graph_rewrite.hpp> | ||
#include <ngraph/variant.hpp> | ||
|
||
#include "low_precision/lpt_visibility.hpp" | ||
#include "low_precision/rt_info/attribute_parameters.hpp" | ||
#include "low_precision/rt_info/shared_value_attribute.hpp" | ||
|
||
namespace ngraph { | ||
/** | ||
* @ingroup ie_transformation_common_api | ||
* @brief PrecisionsAttribute defines precision which is required for input/output port or an operation. | ||
*/ | ||
class LP_TRANSFORMATIONS_API SkipCleanupAttribute : public SharedAttribute<bool> { | ||
public: | ||
OPENVINO_RTTI("LowPrecision::SkipCleanup", "", ov::RuntimeAttribute, 0); | ||
SkipCleanupAttribute(const bool skip); | ||
|
||
static ov::Any create(const std::shared_ptr<ngraph::Node>& node, const bool skip); | ||
// vizualize shared attributes details in VizualizeTree pass | ||
std::string to_string() const override; | ||
}; | ||
} // namespace ngraph |
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
38 changes: 38 additions & 0 deletions
38
src/common/low_precision_transformations/src/rt_info/skip_cleanup_attribute.cpp
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,38 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "low_precision/rt_info/skip_cleanup_attribute.hpp" | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <iterator> | ||
#include <vector> | ||
|
||
#include <ngraph/opsets/opset1.hpp> | ||
#include "low_precision/network_helper.hpp" | ||
#include "low_precision/layer_transformation.hpp" | ||
|
||
using namespace ngraph; | ||
using namespace ov; | ||
|
||
SkipCleanupAttribute::SkipCleanupAttribute(const bool skip) | ||
: | ||
SharedAttribute(skip) { | ||
} | ||
|
||
ov::Any SkipCleanupAttribute::create( | ||
const std::shared_ptr<ngraph::Node>& node, | ||
const bool skip) { | ||
auto& rt = node->get_rt_info(); | ||
return (rt[SkipCleanupAttribute::get_type_info_static()] = SkipCleanupAttribute(skip)); | ||
} | ||
|
||
std::string SkipCleanupAttribute::to_string() const { | ||
std::stringstream ss; | ||
ss << "SkipCleanup: {"; | ||
attribute ? ss << "True" : ss << "False"; | ||
ss << "}"; | ||
return ss.str(); | ||
} |
Oops, something went wrong.