Test case 1: cache data in file.
| 97 | |
| 98 | // Test case 1: cache data in file. |
| 99 | TestCase TestCase1() { |
| 100 | return {/*input_tensors*/ {CreateTensor<int64>(TensorShape{3, 3, 1}, |
| 101 | {0, 1, 2, 3, 4, 5, 6, 7, 8})}, |
| 102 | /*file_name*/ absl::StrCat(testing::TmpDir(), "/cache_data"), |
| 103 | /*expected_outputs*/ |
| 104 | {CreateTensor<int64>(TensorShape{3, 1}, {0, 1, 2}), |
| 105 | CreateTensor<int64>(TensorShape{3, 1}, {3, 4, 5}), |
| 106 | CreateTensor<int64>(TensorShape{3, 1}, {6, 7, 8})}, |
| 107 | /*expected_output_dtypes*/ {DT_INT64}, |
| 108 | /*expected_output_shapes*/ {PartialTensorShape({3, 1})}, |
| 109 | /*expected_cardinality*/ 3, |
| 110 | /*breakpoints*/ {0, 2, 4, 11}}; |
| 111 | } |
| 112 | |
| 113 | // Test case 2: cache empty data in file. |
| 114 | TestCase TestCase2() { |
no test coverage detected