• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020-2021 Huawei Technologies Co., Ltd
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 #ifndef MINDSPORE_CORE_OPS_DE_CONV2D_GRAD_FILTER_H_
18 #define MINDSPORE_CORE_OPS_DE_CONV2D_GRAD_FILTER_H_
19 #include <vector>
20 
21 #include "mindapi/base/format.h"
22 #include "mindapi/base/types.h"
23 #include "ops/base_operator.h"
24 
25 namespace mindspore {
26 namespace ops {
27 constexpr auto kNameDeConv2DGradFilter = "DeConv2DGradFilter";
28 class MIND_API DeConv2DGradFilter : public BaseOperator {
29  public:
30   MIND_API_BASE_MEMBER(DeConv2DGradFilter);
DeConv2DGradFilter()31   DeConv2DGradFilter() : BaseOperator(kNameDeConv2DGradFilter) {}
32   void Init(const int64_t in_channel, const int64_t out_channel, const std::vector<int64_t> &kernel_size,
33             const PadMode &pad_mode, const std::vector<int64_t> &pad_list, const std::vector<int64_t> &stride,
34             const std::vector<int64_t> &dilation, const int64_t group, const Format &format = NCHW,
35             const ActivationType &activation_type = NO_ACTIVATION, const bool has_bias = false);
36   void set_in_channel(const int64_t in_channel);
37   void set_out_channel(const int64_t out_channel);
38   void set_kernel_size(const std::vector<int64_t> &kernel_size);
39   void set_pad_mode(const PadMode &pad_mode);
40   void set_pad_list(const std::vector<int64_t> &pad_list);
41   void set_stride(const std::vector<int64_t> &stride);
42   void set_dilation(const std::vector<int64_t> &dilation);
43   void set_group(const int64_t group);
44   void set_format(const Format &format);
45   void set_activation_type(const ActivationType &activation_type);
46   void set_has_bias(const bool has_bias);
47   //  kernel_size(h, w)
48   //  stride(h, w)
49   //  pad_list(up, down, left, right)
50 
51   int64_t get_in_channel() const;
52   int64_t get_out_channel() const;
53   std::vector<int64_t> get_kernel_size() const;
54   PadMode get_pad_mode() const;
55   std::vector<int64_t> get_pad_list() const;
56   std::vector<int64_t> get_stride() const;
57   std::vector<int64_t> get_dilation() const;
58   int64_t get_group() const;
59   Format get_format() const;
60   ActivationType get_activation_type() const;
61   bool get_has_bias() const;
62 };
63 }  // namespace ops
64 }  // namespace mindspore
65 
66 #endif  // MINDSPORE_CORE_OPS_DE_CONV2D_GRAD_FILTER_H_
67