(value, name="unpool")
return out
Unpooling operation.

  N-dimensional version of the unpooling operation from
  https://www.robots.ox.ac.uk/~vgg/rg/papers/Dosovitskiy_Learning_to_Generate_2015_CVPR_paper.pdf
  Taken from: https://github.com/tensorflow/tensorflow/issues/2169

  Args:
    value: a Tensor of shape [b, d0, d1, ..., dn, ch]
    name: name of the op
  Returns:
    A Tensor of shape [b, 2*d0, 2*d1, ..., 2*dn, ch]
Unpooling operation.
Unpooling operation .
def unpool(value, name="unpool"):
  """Unpooling operation.

  N-dimensional version of the unpooling operation from
  https://www.robots.ox.ac.uk/~vgg/rg/papers/Dosovitskiy_Learning_to_Generate_2015_CVPR_paper.pdf
  Taken from: https://github.com/tensorflow/tensorflow/issues/2169

  Args:
    value: a Tensor of shape [b, d0, d1, ..., dn, ch]
    name: name of the op
  Returns:
    A Tensor of shape [b, 2*d0, 2*d1, ..., 2*dn, ch]
  """
  with tf.name_scope(name) as scope:
    sh = value.get_shape().as_list()
    dim = len(sh[1:-1])
    out = (tf.reshape(value, [-1] + sh[-dim:]))
    for i in range(dim, 0, -1):
      out = tf.concat([out, tf.zeros_like(out)], i)
    out_size = [-1] + [s * 2 for s in sh[1:-1]] + [sh[-1]]
    out = tf.reshape(out, out_size, name=scope)
  return out
def unpool ( value , name = "unpool" ) : with tf . name_scope ( name ) as scope : sh = value . get_shape ( ) . as_list ( ) dim = len ( sh [ 1 : - 1 ] ) out = ( tf . reshape ( value , [ - 1 ] + sh [ - dim : ] ) ) for i in range ( dim , 0 , - 1 ) : out = tf . concat ( [ out , tf . zeros_like ( out ) ] , i ) out_size = [ - 1 ] + [ s * 2 for s in sh [ 1 : - 1 ] ] + [ sh [ - 1 ] ] out = tf . reshape ( out , out_size , name = scope ) return out