code: def linear_upsample_3d(
      inputs,
      strides=(2, 2, 2),
      use_bias=False,
      trainable=False,
      name="linear_upsample_3d",
  ):
      """Linear upsampling layer in 3D using strided transpose convolutions. The
          upsampling kernel size will be automatically computed to avoid
          information loss.
  
      Args:
          inputs (tf.Tensor): Input tensor to be upsampled
          strides (tuple, optional): The strides determine the upsampling factor
              in each dimension.
          use_bias (bool, optional): Flag to train an additional bias.
          trainable (bool, optional): Flag to set the variables to be trainable or not.
          name (str, optional): Name of the layer.
  
      Returns:
          tf.Tensor: Upsampled Tensor
      """
      static_inp_shape = tuple(inputs.get_shape().as_list())
      dyn_inp_shape = tf.shape(inputs)
      rank = len(static_inp_shape)
  
      num_filters = static_inp_shape[-1]
      strides_5d = (
          [
              1,
          ]
          + list(strides)
          + [
              1,
          ]
      )
      kernel_size = [2 * s if s > 1 else 1 for s in strides]
  
      kernel = get_linear_upsampling_kernel(
          kernel_spatial_shape=kernel_size,
          out_filters=num_filters,
          in_filters=num_filters,
          trainable=trainable,
      )
  
      dyn_out_shape = [
          dyn_inp_shape[i] * strides_5d[i] for i in range(rank)
      ]
      dyn_out_shape[-1] = num_filters
  
      static_out_shape = [
          static_inp_shape[i] * strides_5d[i]
          if isinstance(static_inp_shape[i], int)
          else None
          for i in range(rank)
      ]
  
      static_out_shape[-1] = num_filters
      tf.logging.info(
          "Upsampling from {} to {}".format(
              static_inp_shape, static_out_shape
          )
      )
  
      upsampled = tf.nn.conv3d_transpose(
          value=inputs,
          filter=kernel,
          output_shape=dyn_out_shape,
          strides=strides_5d,
          padding="SAME",
          name="upsample",
      )
  
      upsampled.set_shape(static_out_shape)
  
      return upsampled
  
imports: from __future__ import unicode_literals
  from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import tensorflow
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: linear_upsample_3d(inputs, strides, use_bias, trainable, name) and returns: upsampled