| 837 | } |
| 838 | |
| 839 | core::TensorValue graph_subpixel_conv( |
| 840 | core::ModuleBuildContext & ctx, |
| 841 | const core::TensorValue & input, |
| 842 | const std::unordered_map<std::string, Param> & params, |
| 843 | const std::string & weight_name, |
| 844 | const std::string & bias_name) { |
| 845 | auto conv = graph_conv2d(ctx, input, params, weight_name, bias_name, 0, 1, 1, 1, 1, 1); |
| 846 | if (conv.shape.dims[1] != kDense * 2) { |
| 847 | throw std::runtime_error("ZipEnhancer graph subpixel conv channel mismatch: " + weight_name); |
| 848 | } |
| 849 | auto x = graph_reshape( |
| 850 | ctx, |
| 851 | conv, |
| 852 | core::TensorShape::from_dims({conv.shape.dims[0], kDense, 2, conv.shape.dims[2] * conv.shape.dims[3]})); |
| 853 | x = graph_transpose(ctx, x, {{0, 1, 3, 2}}, 4); |
| 854 | return graph_reshape(ctx, x, core::TensorShape::from_dims({conv.shape.dims[0], kDense, conv.shape.dims[2], conv.shape.dims[3] * 2})); |
| 855 | } |
| 856 | |
| 857 | core::TensorValue graph_mapping_decoder( |
| 858 | core::ModuleBuildContext & ctx, |
no test coverage detected