Test case 2: the reduce function has two inputs and two outputs. As the number of components of initial_state need to match with the reduce function outputs, the initial_state will have two components. It results in that the components of initial_state will be all the inputs for the reduce function, and the input dataset will not be involved in the reduce/aggregation process.
| 101 | // function, and the input dataset will not be involved in the |
| 102 | // reduce/aggregation process. |
| 103 | TestCase TestCase2() { |
| 104 | return {/*range_data_param*/ {1, 10, 1}, |
| 105 | /*initial_state*/ |
| 106 | {CreateTensor<int64>(TensorShape({}), {1}), |
| 107 | CreateTensor<int64>(TensorShape({}), {1})}, |
| 108 | /*func*/ |
| 109 | FunctionDefHelper::FunctionRef("XPlusOneXTimesY", {{"T", DT_INT64}}), |
| 110 | /*func_lib*/ {test::function::XPlusOneXTimesY()}, |
| 111 | /*t_state*/ {DT_INT64, DT_INT64}, |
| 112 | /*use_inter_op_parallelism*/ true, |
| 113 | /*expected_outputs*/ |
| 114 | {CreateTensor<int64>(TensorShape({}), {10}), |
| 115 | CreateTensor<int64>(TensorShape({}), |
| 116 | {1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9})}, |
| 117 | /*output_dtypes*/ {DT_INT64, DT_INT64}, |
| 118 | /*output_shapes*/ {PartialTensorShape({}), PartialTensorShape({})}}; |
| 119 | } |
| 120 | |
| 121 | // Test case 3: the input dataset has no outputs, so the reduce dataset just |
| 122 | // returns the initial state. |
no test coverage detected