-
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
1 parent
d4e9547
commit f3760b3
Showing
41 changed files
with
1,408 additions
and
153 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
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 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <ngraph/op/op.hpp> | ||
|
||
namespace ngraph { | ||
namespace snippets { | ||
namespace op { | ||
|
||
/** | ||
* @interface Buffer | ||
* @brief TODO | ||
* @ingroup snippets | ||
*/ | ||
class Buffer : public ngraph::op::Op { | ||
public: | ||
OPENVINO_OP("Buffer", "SnippetsOpset"); | ||
|
||
Buffer(const Output<Node>& x, const size_t offset = 0); | ||
Buffer() = default; | ||
|
||
size_t get_offset() const; | ||
void set_offset(const size_t offset); | ||
|
||
bool visit_attributes(AttributeVisitor& visitor) override { return true; }; | ||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override; | ||
void validate_and_infer_types() override; | ||
|
||
private: | ||
size_t offset; | ||
}; | ||
|
||
} // namespace op | ||
} // namespace snippets | ||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <ngraph/op/op.hpp> | ||
|
||
namespace ngraph { | ||
namespace snippets { | ||
namespace op { | ||
|
||
/** | ||
* @interface Fill | ||
* @brief TODO | ||
* @ingroup snippets | ||
*/ | ||
class Fill : public ngraph::op::Op { | ||
public: | ||
OPENVINO_OP("Fill", "SnippetsOpset"); | ||
|
||
Fill(const Output<Node>& x, const int64_t offset, const std::string fill_value = "zero"); | ||
Fill() = default; | ||
|
||
int64_t get_offset() const { return m_offset; } | ||
std::string get_fill_value() const { return m_fill_value; } | ||
|
||
void set_offset(const size_t offset) { m_offset = offset; } | ||
void set_fill_value(const std::string fill_value) { m_fill_value = fill_value; } | ||
|
||
bool visit_attributes(AttributeVisitor& visitor) override; | ||
|
||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override; | ||
|
||
void validate_and_infer_types() override; | ||
|
||
protected: | ||
int64_t m_offset = 0lu; | ||
std::string m_fill_value = "zero"; | ||
}; | ||
|
||
} // namespace op | ||
} // namespace snippets | ||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "ngraph/op/op.hpp" | ||
|
||
namespace ngraph { | ||
namespace snippets { | ||
namespace op { | ||
|
||
/** | ||
* @interface HorizonMax | ||
* @brief TODO | ||
* @ingroup snippets | ||
*/ | ||
class HorizonMax : public ngraph::op::Op { | ||
public: | ||
OPENVINO_OP("HorizonMax", "SnippetsOpset"); | ||
|
||
HorizonMax(const Output<Node>& x); | ||
HorizonMax() = default; | ||
|
||
bool visit_attributes(AttributeVisitor& visitor) override { return true;} | ||
|
||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override; | ||
void validate_and_infer_types() override; | ||
}; | ||
|
||
} // namespace op | ||
} // namespace snippets | ||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "ngraph/op/op.hpp" | ||
|
||
namespace ngraph { | ||
namespace snippets { | ||
namespace op { | ||
|
||
/** | ||
* @interface HorizonSum | ||
* @brief TODO | ||
* @ingroup snippets | ||
*/ | ||
class HorizonSum : public ngraph::op::Op { | ||
public: | ||
OPENVINO_OP("HorizonSum", "SnippetsOpset"); | ||
|
||
HorizonSum(const Output<Node>& x); | ||
HorizonSum() = default; | ||
|
||
bool visit_attributes(AttributeVisitor& visitor) override { return true;} | ||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override; | ||
void validate_and_infer_types() override; | ||
}; | ||
|
||
} // namespace op | ||
} // namespace snippets | ||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <ngraph/op/op.hpp> | ||
|
||
namespace ngraph { | ||
namespace snippets { | ||
namespace op { | ||
|
||
/** | ||
* @interface Buffer | ||
* @brief TODO | ||
* @ingroup snippets | ||
*/ | ||
class VectorBuffer : public ngraph::op::Op { | ||
public: | ||
OPENVINO_OP("VectorBuffer", "SnippetsOpset"); | ||
|
||
VectorBuffer(); | ||
|
||
bool visit_attributes(AttributeVisitor& visitor) override { return true;} | ||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override; | ||
void validate_and_infer_types() override; | ||
}; | ||
|
||
} // namespace op | ||
} // namespace snippets | ||
} // namespace ngraph |
26 changes: 26 additions & 0 deletions
26
src/common/snippets/include/snippets/pass/softmax_decomposition.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,26 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <ngraph/pass/graph_rewrite.hpp> | ||
#include <ngraph/pattern/matcher.hpp> | ||
|
||
namespace ngraph { | ||
namespace snippets { | ||
namespace pass { | ||
|
||
/** | ||
* @interface SoftmaxDecomposition | ||
* @brief TODO | ||
* @ingroup snippets | ||
*/ | ||
class SoftmaxDecomposition: public ngraph::pass::MatcherPass { | ||
public: | ||
SoftmaxDecomposition(const size_t vector_size); | ||
}; | ||
|
||
} // namespace pass | ||
} // namespace snippets | ||
} // 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
Oops, something went wrong.