1 /** 2 * Copyright 2020 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 #ifndef MINDSPORE_INCLUDE_API_OPS_OPS_H 17 #define MINDSPORE_INCLUDE_API_OPS_OPS_H 18 19 #include <string> 20 #include <vector> 21 #include <map> 22 #include <memory> 23 #include "include/api/status.h" 24 #include "include/api/types.h" 25 #include "include/api/cell.h" 26 27 namespace mindspore { 28 struct MS_API Conv2D : public OpCell<Conv2D> { Conv2DConv2D29 Conv2D() : OpCell("Conv2D") {} 30 ~Conv2D() override = default; 31 std::vector<Output> Construct(const std::vector<Input> &inputs) override; 32 Conv2D(int out_channel, const std::vector<int> &kernel_size, int mode = 1, const std::string &pad_mode = "valid", 33 const std::vector<int> &pad = {0, 0, 0, 0}, const std::vector<int> &stride = {1, 1, 1, 1}, 34 const std::vector<int> &dilation = {1, 1, 1, 1}, int group = 1); 35 36 Output operator()(const Input &, const Input &) const; 37 38 int out_channel; 39 std::vector<int> kernel_size; 40 int mode = 1; 41 std::string pad_mode = "valid"; 42 std::vector<int> pad = {0, 0, 0, 0}; 43 std::vector<int> stride = {1, 1, 1, 1}; 44 std::vector<int> dilation = {1, 1, 1, 1}; 45 int group = 1; 46 }; 47 } // namespace mindspore 48 #endif // MINDSPORE_INCLUDE_API_OPS_OPS_H 49