Deprecate nGraph v0 ops and builders (#1856)
[platform/upstream/dldt.git] / ngraph / core / include / ngraph / builder / split.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 #include <memory>
19
20 #include "ngraph/node.hpp"
21
22 namespace ngraph
23 {
24     namespace builder
25     {
26         /// \brief     Split value on specified axis into multiple parts.
27         ///
28         /// \param     value         The value to be split.
29         /// \param     length_parts  The vector defining the lengths of each split part.
30         /// \param     axis          The axis we split input node on. Default value is zero axis.
31         ///
32         /// \return     The vector containing multiple nodes we split input node into.
33         ///
34         NGRAPH_DEPRECATED("This builder was deprecated.")
35         OutputVector split(const Output<Node>& value,
36                            const std::vector<size_t>& length_parts,
37                            size_t axis = 0);
38
39         /// \brief      Split node on specified axis into multiple parts.
40         ///
41         /// \param   value         The value to split.
42         /// \param   split_parts   The number of parts we want to split output at given
43         ///                        axis. The length of the axis to split must be divisible by
44         ///                        this value.
45         /// \param   axis          The axis we split input node on. Default value is zero axis.
46         ///
47         /// \note       This implementation supports negative `axis` values (similar to NumPy
48         ///             indexing). This means that the axis to split on will be counted from
49         ///             the back of the tensor (negative values are subtracted from its rank).
50         ///
51         /// \return     The vector containing multiple outputs we split input node into.
52         ///
53         NGRAPH_DEPRECATED("This builder was deprecated.")
54         NGRAPH_API
55         OutputVector split(const Output<Node>& value, size_t split_parts, int axis = 0);
56
57         namespace opset1
58         {
59             /// \brief      Split value on specified axis into multiple parts.
60             ///
61             /// \param  value          The value to be split.
62             /// \param  split_lengths  The vector defining the lengths of each split part.
63             /// \param  axis           The axis we split input node on. Default value is zero
64             ///                        axis.
65             /// \note       This implementation supports negative `axis` values (similar to NumPy
66             ///             indexing). This means that the axis to split on will be counted from
67             ///             the back of the tensor (negative values are subtracted from its rank).
68             ///
69             /// \return     The vector containing multiple outputs we split input node into.
70             ///             The vector is output of Split:v1 op
71             ///
72             NGRAPH_API
73             OutputVector split(const Output<Node>& value,
74                                const std::vector<size_t>& split_lengths,
75                                int64_t axis = 0);
76
77             /// \brief      Split value on specified axis into multiple parts.
78             ///
79             /// \param  value         The value to split.
80             /// \param  num_splits    The number of parts we want to split output at given
81             ///                       axis. The length of the axis to split must be divisible by
82             ///                       this value.
83             /// \param  axis          The axis we split input node on. Default value is zero
84             ///                       axis.
85             ///
86             /// \note       This implementation supports negative `axis` values (similar to NumPy
87             ///             indexing). This means that the axis to split on will be counted from
88             ///             the back of the tensor (negative values are subtracted from its rank).
89             ///
90             /// \return     The vector containing multiple nodes we split input node into.
91             ///             The vector is output of VariadicSplit:v1 op
92             ///
93             NGRAPH_API
94             OutputVector split(const Output<Node>& value, size_t num_splits, int64_t axis = 0);
95         }
96     } // namespace builder
97 } // namespace ngraph