| 22 | namespace tensorflow { |
| 23 | |
| 24 | TEST(LinalgOpsTest, MatrixDeterminant_ShapeFn) { |
| 25 | ShapeInferenceTestOp op("MatrixDeterminant"); |
| 26 | INFER_OK(op, "?", "?"); |
| 27 | INFER_ERROR("Shape must be at least rank 2 but is rank 1", op, "[1]"); |
| 28 | INFER_ERROR("Dimensions must be equal, but are 2 and 1", op, "[1,?,3,4,1,2]"); |
| 29 | |
| 30 | INFER_OK(op, "[?,?]", "[]"); |
| 31 | INFER_OK(op, "[1,?]", "[]"); |
| 32 | INFER_OK(op, "[?,1]", "[]"); |
| 33 | |
| 34 | // Repeat previous block of tests with input rank > 2. |
| 35 | INFER_OK(op, "[1,?,3,4,?,?]", "[d0_0,d0_1,d0_2,d0_3]"); |
| 36 | INFER_OK(op, "[1,?,3,4,1,?]", "[d0_0,d0_1,d0_2,d0_3]"); |
| 37 | INFER_OK(op, "[1,?,3,4,?,1]", "[d0_0,d0_1,d0_2,d0_3]"); |
| 38 | } |
| 39 | |
| 40 | TEST(LinalgOpsTest, UnchangedSquare_ShapeFn) { |
| 41 | for (const char* op_name : {"Cholesky", "CholeskyGrad", "MatrixInverse"}) { |
nothing calls this directly
no test coverage detected