code: def upsample_filters(filters, rate):
      """Upsamples the filters by a factor of rate along the spatial dimensions.
  
      Args:
        filters: spatial_shape + [in_channels, out_channels]
          Original filters.
        rate: A list of len(spatial_shape) positive ints, specifying the
          upsampling rate.
  
      Returns:
        filters_up: output_spatial_shape + [in_channels, out_channels].
          Upsampled filters with
          output_spatial_shape[i] = (spatial_shape[i] - 1) * rate[i] + 1
          containing (rate[i] - 1) zeros between consecutive filter values along
          spatial dimension i.
      """
      num_spatial_dims = len(rate)
      spatial_shape = np.array(filters.shape[:num_spatial_dims])
      output_spatial_shape = (spatial_shape - 1) * rate + 1
      output = np.zeros(
          tuple(output_spatial_shape) + tuple(filters.shape[-2:]),
          filters.dtype,
      )
      output[
          tuple(np.s_[:: rate[i]] for i in range(num_spatial_dims))
      ] = filters
      return output
  
imports: import contextlib
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import nn_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: upsample_filters(filters, rate) and returns: output