mod.hpp
1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //*****************************************************************************
16 
17 #pragma once
18 
19 #include "ngraph/node.hpp"
20 #include "ngraph/op/op.hpp"
21 #include "ngraph/op/util/fused_op.hpp"
22 
23 NGRAPH_SUPPRESS_DEPRECATED_START
24 
25 namespace ngraph
26 {
27  namespace op
28  {
29  namespace v1
30  {
31  /// \brief Mod returns an element-wise division reminder with two given tensors applying
32  /// multi-directional broadcast rules.
33  class NGRAPH_API Mod : public ngraph::op::util::FusedOp
34  {
35  public:
36  static constexpr NodeTypeInfo type_info{"Mod", 0};
37  const NodeTypeInfo& get_type_info() const override { return type_info; }
38  Mod() = default;
39  /// \brief Constructs a Mod node.
40  ///
41  /// \param A - Dividend tensor
42  /// \param B - Divisor tensor
43  /// \param auto_broadcast Auto broadcast specification
44  Mod(const Output<Node>& A,
45  const Output<Node>& B,
46  const AutoBroadcastSpec& auto_broadcast = AutoBroadcastType::NUMPY);
47 
48  bool visit_attributes(AttributeVisitor& visitor) override;
49  virtual OutputVector decompose_op() const override;
50 
51  virtual std::shared_ptr<Node>
52  clone_with_new_inputs(const OutputVector& new_args) const override;
53 
54  const AutoBroadcastSpec& get_auto_broadcast() const { return m_auto_broadcast; }
55  private:
56  AutoBroadcastSpec m_auto_broadcast;
57  };
58  }
59  }
60 }
61 
62 NGRAPH_SUPPRESS_DEPRECATED_END
ngraph::op::v1::Mod
Mod returns an element-wise division reminder with two given tensors applying multi-directional broad...
Definition: mod.hpp:34
ngraph::op::AutoBroadcastSpec
Implicit broadcast specification.
Definition: attr_types.hpp:321
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::AttributeVisitor
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:70
ngraph::op::v1::Mod::Mod
Mod(const Output< Node > &A, const Output< Node > &B, const AutoBroadcastSpec &auto_broadcast=AutoBroadcastType::NUMPY)
Constructs a Mod node.