| 27 | namespace TEngine { |
| 28 | |
| 29 | bool 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 | |
| 61 | void Gemm::SetSchema(void) |
| 62 | { |
nothing calls this directly
no test coverage detected