| 75 | }; |
| 76 | |
| 77 | TEST_F(SummaryImageOpTest, ThreeGrayImagesOutOfFive4dInput) { |
| 78 | MakeOp(3 /* max images */); |
| 79 | |
| 80 | // Feed and run |
| 81 | AddInputFromArray<tstring>(TensorShape({}), {"tag"}); |
| 82 | AddInputFromArray<float>(TensorShape({5, 2, 1, 1}), |
| 83 | {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}); |
| 84 | TF_ASSERT_OK(RunOpKernel()); |
| 85 | |
| 86 | // Check the output size. |
| 87 | Tensor* out_tensor = GetOutput(0); |
| 88 | ASSERT_EQ(0, out_tensor->dims()); |
| 89 | Summary summary; |
| 90 | ParseProtoUnlimited(&summary, out_tensor->scalar<tstring>()()); |
| 91 | |
| 92 | CheckAndRemoveEncodedImages(&summary); |
| 93 | EXPECT_SummaryMatches(summary, R"( |
| 94 | value { tag: 'tag/image/0' image { width: 1 height: 2 colorspace: 1} } |
| 95 | value { tag: 'tag/image/1' image { width: 1 height: 2 colorspace: 1} } |
| 96 | value { tag: 'tag/image/2' image { width: 1 height: 2 colorspace: 1} } |
| 97 | )"); |
| 98 | } |
| 99 | |
| 100 | TEST_F(SummaryImageOpTest, OneGrayImage4dInput) { |
| 101 | MakeOp(1 /* max images */); |
nothing calls this directly
no test coverage detected