Resizes the volume contained in a 5D tensor. Arguments: x: Tensor or variable to resize. depth_factor: Positive integer. height_factor: Positive integer. width_factor: Positive integer. data_format: One of `"channels_first"`, `"channels_last"`. Returns: A te
(x, depth_factor, height_factor, width_factor, data_format)
| 2719 | |
| 2720 | @keras_export('keras.backend.resize_volumes') |
| 2721 | def resize_volumes(x, depth_factor, height_factor, width_factor, data_format): |
| 2722 | """Resizes the volume contained in a 5D tensor. |
| 2723 | |
| 2724 | Arguments: |
| 2725 | x: Tensor or variable to resize. |
| 2726 | depth_factor: Positive integer. |
| 2727 | height_factor: Positive integer. |
| 2728 | width_factor: Positive integer. |
| 2729 | data_format: One of `"channels_first"`, `"channels_last"`. |
| 2730 | |
| 2731 | Returns: |
| 2732 | A tensor. |
| 2733 | |
| 2734 | Raises: |
| 2735 | ValueError: if `data_format` is neither |
| 2736 | `channels_last` or `channels_first`. |
| 2737 | """ |
| 2738 | if data_format == 'channels_first': |
| 2739 | output = repeat_elements(x, depth_factor, axis=2) |
| 2740 | output = repeat_elements(output, height_factor, axis=3) |
| 2741 | output = repeat_elements(output, width_factor, axis=4) |
| 2742 | return output |
| 2743 | elif data_format == 'channels_last': |
| 2744 | output = repeat_elements(x, depth_factor, axis=1) |
| 2745 | output = repeat_elements(output, height_factor, axis=2) |
| 2746 | output = repeat_elements(output, width_factor, axis=3) |
| 2747 | return output |
| 2748 | else: |
| 2749 | raise ValueError('Invalid data_format: ' + str(data_format)) |
| 2750 | |
| 2751 | |
| 2752 | @keras_export('keras.backend.repeat_elements') |
nothing calls this directly
no test coverage detected