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

Method InferShape

operator/operator/interp.cpp:28–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace TEngine {
27
28bool 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
59void Interp::SetSchema(void)
60{

Callers

nothing calls this directly

Calls 7

GetNMethod · 0.80
GetCMethod · 0.80
GetHMethod · 0.80
GetWMethod · 0.80
SetDimMethod · 0.80
SetDataLayoutMethod · 0.80
GetDataLayoutMethod · 0.80

Tested by

no test coverage detected