Return in the result of making the end of a square matrix.
| 27 | |
| 28 | // Return in <out> the result of making the end of <s> a square matrix. |
| 29 | Status MakeBatchSquareMatrix(InferenceContext* c, ShapeHandle input, |
| 30 | ShapeHandle* out) { |
| 31 | ShapeHandle s; |
| 32 | TF_RETURN_IF_ERROR(c->WithRankAtLeast(input, 2, &s)); |
| 33 | |
| 34 | DimensionHandle d; |
| 35 | TF_RETURN_IF_ERROR(c->Merge(c->Dim(s, -2), c->Dim(s, -1), &d)); |
| 36 | |
| 37 | ShapeHandle batch_shape; |
| 38 | TF_RETURN_IF_ERROR(c->Subshape(s, 0, -2, &batch_shape)); |
| 39 | TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Matrix(d, d), out)); |
| 40 | return Status::OK(); |
| 41 | } |
| 42 | |
| 43 | Status BatchUnchangedSquareShapeFn(InferenceContext* c) { |
| 44 | ShapeHandle out; |
no test coverage detected