Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / mkldnn_plugin / nodes / mkldnn_deconv_node.h
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <ie_common.h>
8 #include <mkldnn_node.h>
9 #include <memory>
10 #include <string>
11 #include <vector>
12
13 namespace MKLDNNPlugin {
14
15 class MKLDNNDeconvolutionNode : public MKLDNNNode {
16 public:
17     MKLDNNDeconvolutionNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng);
18     ~MKLDNNDeconvolutionNode() override = default;
19
20     void getSupportedDescriptors() override;
21     void createDescriptor(const std::vector<InferenceEngine::TensorDesc>& inputDesc,
22                           const std::vector<InferenceEngine::TensorDesc>& outputDesc) override;
23     void createPrimitive() override;
24     void execute(mkldnn::stream strm) override;
25     bool created() const override;
26     bool canBeInPlace() const override {
27         return false;
28     }
29
30     MKLDNNMemoryDesc getSrcMemDesc(mkldnn::primitive_desc_iterator &primitive_desc_it, size_t idx) override;
31     MKLDNNMemoryDesc getDstMemDesc(mkldnn::primitive_desc_iterator &primitive_desc_it, size_t idx) override;
32
33 private:
34     bool withBiases;
35     bool withGroups;
36     bool isDW;
37     size_t groupNum = 1;
38     std::vector<ptrdiff_t> stride;
39     std::vector<ptrdiff_t> paddingL;
40     std::vector<ptrdiff_t> dilation;
41     std::vector<ptrdiff_t> paddingR;
42     MKLDNNDims weightsDims;
43     static Register<MKLDNNDeconvolutionNode> reg;
44     InferenceEngine::Blob::Ptr biases;
45     std::vector<std::shared_ptr<mkldnn::convolution_forward::desc>> descs_fwd;
46     std::vector<std::shared_ptr<mkldnn::convolution_backward_data::desc>> descs_bwd;
47 };
48
49 }  // namespace MKLDNNPlugin
50