Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / CPP / depth_to_space.hpp
1 /*
2 // Copyright (c) 2019 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 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #pragma once
19
20 #include "../C/depth_to_space.h"
21 #include "primitive.hpp"
22
23 namespace  cldnn
24 {
25 /// @addtogroup cpp_api C++ API
26 /// @{
27 /// @addtogroup cpp_topology Network Topology
28 /// @{
29 /// @addtogroup cpp_primitives Primitives
30 /// @{
31
32 /// @brief
33 /// @details
34 struct depth_to_space : public primitive_base<depth_to_space, CLDNN_PRIMITIVE_DESC(depth_to_space)>
35 {
36     CLDNN_DECLARE_PRIMITIVE(depth_to_space)
37
38     /// @brief Constructs depth_to_space primitive.
39     /// @param id This primitive id.
40     /// @param input Input dictionary primitive id.
41     /// @param block_size Block size.
42     depth_to_space(
43         const primitive_id& id,
44         const primitive_id& input,
45         const size_t block_size,
46         const padding& output_padding = padding()
47     )
48         : primitive_base(id, {input}, output_padding)
49         , block_size(block_size)
50     {
51     }
52
53     /// @brief Constructs a copy from C API @CLDNN_PRIMITIVE_DESC{depth_to_space}
54     depth_to_space(const dto* dto)
55         : primitive_base(dto)
56         , block_size(dto->block_size)
57     {
58     }
59
60     /// @brief Block size.
61     size_t block_size;
62 protected:
63
64     void update_dto(dto& dto) const override
65     {
66         dto.block_size = block_size;
67     }
68 };
69 /// @}
70 /// @}
71 /// @}
72 }