Introduce setters for opset7::Gelu (#13315)

* Introduce setters for opset7::Gelu

* upd

* upd
This commit is contained in:
Evgenya Stepyreva 2022-10-04 14:38:13 +04:00 committed by GitHub
parent f39488ace0
commit f82a8cf93a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -13,9 +13,9 @@ namespace v0 {
/// \brief Gaussian Error Linear Unit
/// f(x) = 0.5 * x * (1 + erf( x / sqrt(2) )
/// \ingroup ov_ops_cpp_api
class OPENVINO_API Gelu : public Op {
class OPENVINO_API Gelu : public util::UnaryElementwiseArithmetic {
public:
OPENVINO_OP("Gelu", "opset2", op::Op, 0);
OPENVINO_OP("Gelu", "opset2", util::UnaryElementwiseArithmetic, 0);
BWDCMP_RTTI_DECLARATION;
Gelu();
@ -44,7 +44,7 @@ namespace v7 {
/// \ingroup ov_ops_cpp_api
class OPENVINO_API Gelu : public util::UnaryElementwiseArithmetic {
public:
OPENVINO_OP("Gelu", "opset7", op::Op, 7);
OPENVINO_OP("Gelu", "opset7", util::UnaryElementwiseArithmetic, 7);
BWDCMP_RTTI_DECLARATION;
Gelu() = default;
@ -66,6 +66,9 @@ public:
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override;
GeluApproximationMode get_approximation_mode() const;
void set_approximation_mode(const GeluApproximationMode& approximation_mode) {
m_approximation_mode = approximation_mode;
}
private:
GeluApproximationMode m_approximation_mode = GeluApproximationMode::ERF;

View File

@ -16,9 +16,9 @@ using namespace ngraph;
// ------------------------------ V0 ------------------------------
BWDCMP_RTTI_DEFINITION(op::v0::Gelu);
op::v0::Gelu::Gelu() : Op() {}
op::v0::Gelu::Gelu() : UnaryElementwiseArithmetic() {}
op::v0::Gelu::Gelu(const Output<Node>& data) : Op({data}) {
op::v0::Gelu::Gelu(const Output<Node>& data) : UnaryElementwiseArithmetic({data}) {
constructor_validate_and_infer_types();
}