Publishing 2019 R2 content (#223)
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / fully_connected_grad_input.hpp
1 /*
2 // Copyright (c) 2018 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 #include "primitive.hpp"
20 #include <vector>
21
22 namespace cldnn {
23 /// @addtogroup cpp_api C++ API
24 /// @{
25 /// @addtogroup cpp_topology Network Topology
26 /// @{
27 /// @addtogroup cpp_primitives Primitives
28 /// @{
29
30 /// @brief Performs backward fully connected layer (inner product) for input.
31 struct fully_connected_grad_input : public primitive_base<fully_connected_grad_input> {
32     CLDNN_DECLARE_PRIMITIVE(fully_connected_grad_input)
33
34     /// @brief Constructs fully connected layer grad for input.
35     /// @param id This primitive id.
36     /// @param input_grad Input gradient primitive id.
37     /// @param input Input primitive id.
38     /// @param weights Primitive id containing weights data.
39     fully_connected_grad_input(
40         const primitive_id& id,
41         const primitive_id& input_grad,
42         const primitive_id& input,
43         const primitive_id& weights,
44         const padding& output_padding = padding())
45         : primitive_base(id, {input_grad, input}, output_padding), weights(weights) {
46     }
47
48     /// @brief Primitive id containing weights data.
49     primitive_id weights;
50
51 protected:
52     std::vector<std::reference_wrapper<const primitive_id>> get_dependencies() const override {
53         return {weights};
54     }
55 };
56 /// @}
57 /// @}
58 /// @}
59 }  // namespace cldnn