tf.nn.depth_to_space(
input, block_size, data_format="NHWC", name=None
)
이 함수는 block size를 기준으로 input tensor의 shape을 재배열해주는 역할을 한다.
input
: input tensor
block_size
: data를 옮길 block size 정의, height
, width
를 옮겨줌
data_format
: input tensor의 shape 기준. e.g) "NHWC"인 경우, (Batch Num, height, Width, Channel)
block size가 2일때, 간단한 예제를 살펴보자.
# input tensor of shape [1,1,1,4]
x = [[[[1, 2, 3, 4]]]]
# output tensor of shape [1,2,2,1]
x = [[[[1], [2]],
[[3], [4]]]]