MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / resize_volumes

Function resize_volumes

tensorflow/python/keras/backend.py:2721–2749  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2719
2720@keras_export('keras.backend.resize_volumes')
2721def 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')

Callers

nothing calls this directly

Calls 1

repeat_elementsFunction · 0.85

Tested by

no test coverage detected