Introduce setters for opset7::Gelu (#13315)
* Introduce setters for opset7::Gelu * upd * upd
This commit is contained in:
parent
f39488ace0
commit
f82a8cf93a
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user