depth_to_space¶
dragon.vm.tensorflow.nn.
depth_to_space
(
input,
block_size,
data_format='NHWC',
name=None
)[source]¶Rearrange depth data into spatial blocks.
Examples:
n, h, w, c, bs = 1, 1, 1, 4, 2 x = tf.range(n * h * w * c).reshape((n, h, w, c)) y = tf.reshape(x, (n, h, w, bs, bs, c // (bs ** 2))) y = tf.transpose(y, (0, 1, 3, 2, 4, 5)) y = tf.reshape(y, (n, h * bs, w * bs, c // (bs ** 2))) z = tf.nn.depth_to_space(x, 2) # Equivalent
- Parameters:
- input (dragon.Tensor) – The input tensor.
- block_size (int, required) – The size of spatial block.
- data_format ({'NCHW', 'NHWC'}, optional) – The optional data format.
- name (str, optional) – The operation name.
- Returns:
dragon.Tensor – The output tensor.