| 177 | } |
| 178 | |
| 179 | core::TensorValue graph_conv2d( |
| 180 | core::ModuleBuildContext & ctx, |
| 181 | const core::TensorValue & input, |
| 182 | const std::unordered_map<std::string, Param> & params, |
| 183 | const std::string & weight_name, |
| 184 | const std::string & bias_name, |
| 185 | int64_t pad_t, |
| 186 | int64_t pad_f, |
| 187 | int64_t stride_t, |
| 188 | int64_t stride_f, |
| 189 | int64_t dil_t, |
| 190 | int64_t dil_f) { |
| 191 | const auto & weight = require_param(params, weight_name); |
| 192 | const auto & bias = require_param(params, bias_name); |
| 193 | if (weight.shape.size() != 4) { |
| 194 | throw std::runtime_error("ZipEnhancer graph conv2d weight shape mismatch: " + weight_name); |
| 195 | } |
| 196 | return modules::Conv2dModule({ |
| 197 | input.shape.dims[1], |
| 198 | weight.shape[0], |
| 199 | weight.shape[2], |
| 200 | weight.shape[3], |
| 201 | static_cast<int>(stride_t), |
| 202 | static_cast<int>(stride_f), |
| 203 | static_cast<int>(pad_t), |
| 204 | static_cast<int>(pad_f), |
| 205 | static_cast<int>(dil_t), |
| 206 | static_cast<int>(dil_f), |
| 207 | true, |
| 208 | }).build(ctx, input, graph_conv2d_weights(weight, bias)); |
| 209 | } |
| 210 | |
| 211 | core::TensorValue graph_instance_norm_prelu( |
| 212 | core::ModuleBuildContext & ctx, |
no test coverage detected