You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

deconvolutiondepthwise.h 2.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // Tencent is pleased to support the open source community by making ncnn available.
  2. //
  3. // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
  4. //
  5. // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
  6. // in compliance with the License. You may obtain a copy of the License at
  7. //
  8. // https://opensource.org/licenses/BSD-3-Clause
  9. //
  10. // Unless required by applicable law or agreed to in writing, software distributed
  11. // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  12. // CONDITIONS OF ANY KIND, either express or implied. See the License for the
  13. // specific language governing permissions and limitations under the License.
  14. #ifndef LAYER_DECONVOLUTIONDEPTHWISE_H
  15. #define LAYER_DECONVOLUTIONDEPTHWISE_H
  16. #include "layer.h"
  17. namespace ncnn {
  18. class DeconvolutionDepthWise : public Layer
  19. {
  20. public:
  21. DeconvolutionDepthWise();
  22. ~DeconvolutionDepthWise();
  23. virtual int load_param(const ParamDict& pd);
  24. virtual int load_model(const ModelBin& mb);
  25. virtual int forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const;
  26. #if NCNN_VULKAN
  27. virtual int upload_model(VkTransfer& cmd);
  28. virtual int create_pipeline();
  29. virtual int destroy_pipeline();
  30. virtual int forward(const VkMat& bottom_blob, VkMat& top_blob, VkCompute& cmd, const Option& opt) const;
  31. #endif // NCNN_VULKAN
  32. public:
  33. // param
  34. int num_output;
  35. int kernel_w;
  36. int kernel_h;
  37. int dilation_w;
  38. int dilation_h;
  39. int stride_w;
  40. int stride_h;
  41. int pad_w;
  42. int pad_h;
  43. int bias_term;
  44. int weight_data_size;
  45. int group;
  46. // model
  47. Mat weight_data;
  48. Mat bias_data;
  49. #if NCNN_VULKAN
  50. VkMat weight_data_gpu;
  51. VkMat bias_data_gpu;
  52. ncnn::Layer* packing_pack1;
  53. ncnn::Layer* packing_pack4;
  54. Pipeline* pipeline_deconvolutiondepthwise;
  55. // pack4
  56. VkMat weight_data_gpu_pack4;
  57. VkMat bias_data_gpu_pack4;
  58. Pipeline* pipeline_deconvolutiondepthwise_pack4;
  59. Pipeline* pipeline_deconvolutiondepthwise_group;
  60. Pipeline* pipeline_deconvolutiondepthwise_group_pack4;
  61. // pack1to4
  62. VkMat weight_data_gpu_pack1to4;
  63. Pipeline* pipeline_deconvolutiondepthwise_group_pack1to4;
  64. // pack4to1
  65. VkMat weight_data_gpu_pack4to1;
  66. Pipeline* pipeline_deconvolutiondepthwise_group_pack4to1;
  67. #endif // NCNN_VULKAN
  68. };
  69. } // namespace ncnn
  70. #endif // LAYER_DECONVOLUTIONDEPTHWISE_H