| 26 | namespace TEngine { |
| 27 | |
| 28 | bool Interp::InferShape(const std::vector<TEngine::TShape>& ishape, std::vector<TEngine::TShape>& oshape, int layout) |
| 29 | { |
| 30 | |
| 31 | const TShape& input = ishape[0]; |
| 32 | int in_n = input.GetN(); |
| 33 | int in_c = input.GetC(); |
| 34 | int in_h = input.GetH(); |
| 35 | int in_w = input.GetW(); |
| 36 | |
| 37 | |
| 38 | param_.output_height = in_h * param_.height_scale; |
| 39 | param_.output_width = in_w * param_.width_scale; |
| 40 | |
| 41 | |
| 42 | TShape out_shape; |
| 43 | |
| 44 | std::vector<int> dim(4); |
| 45 | |
| 46 | dim[0] = in_n; |
| 47 | dim[1] = in_c; |
| 48 | dim[2] = param_.output_height; |
| 49 | dim[3] = param_.output_width; |
| 50 | |
| 51 | out_shape.SetDim(dim); |
| 52 | out_shape.SetDataLayout(input.GetDataLayout()); |
| 53 | |
| 54 | oshape[0] = out_shape; |
| 55 | |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | void Interp::SetSchema(void) |
| 60 | { |
nothing calls this directly
no test coverage detected