MCPcopy Create free account
hub / github.com/OAID/Tengine / InferShape

Method InferShape

operator/operator/upsample.cpp:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26namespace TEngine {
27bool 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}
45void Upsample::SetSchema(void)
46{
47 Input({"input:float32"}).Output({"output:float32"}).SetAttr("scale", 1).SetDoc(R"DOC(Upsample Operator)DOC");

Callers

nothing calls this directly

Calls 2

SetDimMethod · 0.80
SetDataLayoutMethod · 0.80

Tested by

no test coverage detected