| 250 | } |
| 251 | |
| 252 | core::TensorValue graph_dense_block( |
| 253 | core::ModuleBuildContext & ctx, |
| 254 | const core::TensorValue & input, |
| 255 | const std::unordered_map<std::string, Param> & params, |
| 256 | const std::string & prefix) { |
| 257 | auto skip = input; |
| 258 | auto x = input; |
| 259 | for (int i = 0; i < 4; ++i) { |
| 260 | const int64_t dilation = int64_t{1} << i; |
| 261 | const int64_t pad_top = dilation; |
| 262 | const std::string base = prefix + ".dense_block." + std::to_string(i); |
| 263 | x = graph_conv2d( |
| 264 | ctx, |
| 265 | graph_pad2d(ctx, skip, 1, 1, pad_top, 0), |
| 266 | params, |
| 267 | base + ".1.weight", |
| 268 | base + ".1.bias", |
| 269 | 0, |
| 270 | 0, |
| 271 | 1, |
| 272 | 1, |
| 273 | dilation, |
| 274 | 1); |
| 275 | x = graph_instance_norm_prelu( |
| 276 | ctx, |
| 277 | x, |
| 278 | params, |
| 279 | base + ".2.weight", |
| 280 | base + ".2.bias", |
| 281 | base + ".3.weight"); |
| 282 | skip = modules::ConcatModule({1}).build(ctx, x, skip); |
| 283 | } |
| 284 | return x; |
| 285 | } |
| 286 | |
| 287 | core::TensorValue graph_dense_encoder( |
| 288 | core::ModuleBuildContext & ctx, |
no test coverage detected