| 25 | |
| 26 | namespace TEngine { |
| 27 | bool Upsample::InferShape(const std::vector<TEngine::TShape>& ishape, std::vector<TEngine::TShape>& oshape, int layout) |
| 28 | { |
| 29 | TShape shape; |
| 30 | ; |
| 31 | std::vector<int> dim; |
| 32 | dim = ishape[0].GetDim(); |
| 33 | int scale = param_.scale; |
| 34 | // NCHW output_h = in_h * scale output_w = in_w * scale; |
| 35 | dim[2] = dim[2] * scale; |
| 36 | dim[3] = dim[3] * scale; |
| 37 | |
| 38 | shape.SetDim(dim); |
| 39 | shape.SetDataLayout(TENGINE_LAYOUT_NCHW); |
| 40 | |
| 41 | oshape[0] = shape; |
| 42 | |
| 43 | return true; |
| 44 | } |
| 45 | void Upsample::SetSchema(void) |
| 46 | { |
| 47 | Input({"input:float32"}).Output({"output:float32"}).SetAttr("scale", 1).SetDoc(R"DOC(Upsample Operator)DOC"); |
nothing calls this directly
no test coverage detected