1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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 //*****************************************************************************
21 #include "ngraph/op/op.hpp"
29 /// \brief Generalized dot product operation, including scalar-tensor product,
31 /// product, and matrix multiplication.
32 class NGRAPH_DEPRECATED(
33 "This operation is deprecated and will be removed soon. Please do not use it.")
34 NGRAPH_API Dot : public Op
36 NGRAPH_SUPPRESS_DEPRECATED_START
38 static constexpr NodeTypeInfo type_info{"Dot", 0};
39 const NodeTypeInfo& get_type_info() const override { return type_info; }
40 /// \brief Constructs a dot product operation.
42 /// \brief Constructs a dot product operation.
44 /// \param arg0 The node producing the first argument.
45 /// \param arg1 The node producing the second argument.
46 /// \param reduction_axes_count The number of axes to dot.
47 Dot(const Output<Node>& arg0,
48 const Output<Node>& arg1,
49 size_t reduction_axes_count,
50 bool has_reduction_axes_count = true);
52 /// \brief Constructs a dot product operation with default dot-axis selection
56 /// If `arg0` or `arg1` is a scalar, there are no dot-axes. Else, there is one
59 /// (Note that in particular, this results in scalar-tensor products where one or
61 /// other argument is a scalar, a matrix-vector products where `arg0` is a matrix
63 /// `arg1` is a vector, and a matrix multiplication where `arg0` and `arg1` are both
66 /// \param arg0 The node producing the first argument.
67 /// \param arg1 The node producing the second argument.
68 Dot(const Output<Node>& arg0, const Output<Node>& arg1);
70 void validate_and_infer_types() override;
72 virtual std::shared_ptr<Node> get_default_value() const override;
74 size_t get_reduction_axes_count() const { return m_reduction_axes_count; }
75 void set_reduction_axes_count(size_t reduction_axes_count)
77 m_reduction_axes_count = reduction_axes_count;
79 bool get_has_reduction_axes_count() const { return m_has_reduction_axes_count; }
80 void set_has_reduction_axes_count(bool has_reduction_axes_count)
82 m_has_reduction_axes_count = has_reduction_axes_count;
84 virtual std::shared_ptr<Node>
85 clone_with_new_inputs(const OutputVector& new_args) const override
87 check_new_args_count(this, new_args);
88 return std::make_shared<Dot>(
89 new_args.at(0), new_args.at(1), m_reduction_axes_count);
93 size_t m_reduction_axes_count;
94 bool m_has_reduction_axes_count;
95 NGRAPH_SUPPRESS_DEPRECATED_END
98 NGRAPH_SUPPRESS_DEPRECATED_START
100 NGRAPH_SUPPRESS_DEPRECATED_END