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

Method InferShape

operator/operator/gemm.cpp:29–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace TEngine {
28
29bool Gemm::InferShape(const std::vector<TEngine::TShape>& ishape, std::vector<TEngine::TShape>& oshape, int layout)
30{
31 int m, n;
32
33 const TShape& input = ishape[0];
34 const TShape& weight = ishape[1];
35
36 if(param_.transA)
37 m = input.Shape(1);
38 else
39 m = input.Shape(0);
40
41 if(param_.transB)
42 n = weight.Shape(0);
43 else
44 n = weight.Shape(1);
45
46 TShape out_shape;
47
48 std::vector<int> dim(2);
49
50 dim[0] = m;
51 dim[1] = n;
52
53 out_shape.SetDim(dim);
54 out_shape.SetDataLayout(input.GetDataLayout());
55
56 oshape[0] = out_shape;
57
58 return true;
59}
60
61void Gemm::SetSchema(void)
62{

Callers

nothing calls this directly

Calls 4

ShapeMethod · 0.80
SetDimMethod · 0.80
SetDataLayoutMethod · 0.80
GetDataLayoutMethod · 0.80

Tested by

no test coverage detected