(example: Dict[str, tf.Tensor])
| 148 | return output_list |
| 149 | |
| 150 | def f(example: Dict[str, tf.Tensor]) -> Dict[str, tf.Tensor]: |
| 151 | input_list = [example[k] for k in preprocess_input_names] |
| 152 | output_types = [v for k, v in preprocess_output_types.items()] |
| 153 | output_list = tf.numpy_function(preprocess_with_list_input_fn, input_list, |
| 154 | output_types) |
| 155 | output_dict = { |
| 156 | k: v for k, v in zip(preprocess_output_types.keys(), output_list) |
| 157 | } |
| 158 | return output_dict |
| 159 | |
| 160 | return f |
| 161 |