| 1329 | data_format_kwargs = dict(data_format=data_format) |
| 1330 | |
| 1331 | def op(converted_input, _, converted_padding): # pylint: disable=missing-docstring |
| 1332 | if num_spatial_dims == 1: |
| 1333 | converted_input = array_ops.expand_dims(converted_input, |
| 1334 | spatial_dims[0]) |
| 1335 | result = pooling_ops[op_key]( |
| 1336 | converted_input, |
| 1337 | adjusted_window_shape, |
| 1338 | adjusted_strides, |
| 1339 | converted_padding, |
| 1340 | name=scope, |
| 1341 | **data_format_kwargs) |
| 1342 | if num_spatial_dims == 1: |
| 1343 | result = array_ops.squeeze(result, [spatial_dims[0]]) |
| 1344 | return result |
| 1345 | |
| 1346 | return with_space_to_batch( |
| 1347 | input=input, |