nn/nn_utils.py
def upsampling_2d(tensor, name, size=(2, 2)):
    """
    Do 2d upsampling of the input tensor by size times
    :param tensor: input tensor, should be a 3d tensor
    :param name: name for this variable scope
    :param size: how many times the input should be upsampled
    :return:
    """
    h, w, _ = tensor.get_shape().as_list()[1:]  # first dim is batch num
    h_multi, w_multi = size
    target_h = h * h_multi
    target_w = w * w_multi

    return tf.image.resize_nearest_neighbor(tensor, (target_h, target_w), name='upsample_{}'.format(name))

    Do 2d upsampling of the input tensor by size times
    :param tensor: input tensor, should be a 3d tensor
    :param name: name for this variable scope
    :param size: how many times the input should be upsampled
    :return:
    
Do 2d upsampling of the input tensor by size times
Do 2d upsampling of the input tensor by size times
def upsampling_2d(tensor, name, size=(2, 2)):
    h, w, _ = tensor.get_shape().as_list()[1:]  
    h_multi, w_multi = size
    target_h = h * h_multi
    target_w = w * w_multi
    return tf.image.resize_nearest_neighbor(tensor, (target_h, target_w), name='upsample_{}'.format(name))
def upsampling_2d ( tensor , name , size = ( 2 , 2 ) ) : h , w , _ = tensor . get_shape ( ) . as_list ( ) [ 1 : ] h_multi , w_multi = size target_h = h * h_multi target_w = w * w_multi return tf . image . resize_nearest_neighbor ( tensor , ( target_h , target_w ) , name = 'upsample_{}' . format ( name ) )
Do 2d upsampling of the input tensor by size times
Do 2d upsampling of the input tensor by size times
"""
    Do 2d upsampling of the input tensor by size times
    :param tensor: input tensor, should be a 3d tensor
    :param name: name for this variable scope
    :param size: how many times the input should be upsampled
    :return:
    """ # first dim is batch num
None
tensor
input tensor, should be a 3d tensor
input tensor should be a 3d tensor
name
name for this variable scope
name for this variable scope
size
None