code: def upsample(x, stride, name=None):
      if isinstance(stride, int):
          stride = (stride, stride)
      assert isinstance(stride, tuple)
      b = tf.shape(x)[0]
      h = tf.shape(x)[1] * stride[0]
      w = tf.shape(x)[2] * stride[1]
      c = int(x.shape[-1]) if tf_later_than("2") else x.shape[-1].value
      x = tf.expand_dims(x, 2)
      x = tf.expand_dims(x, 4)
      x = tf.tile(x, (1, 1, stride[0], 1, stride[1], 1))
      return tf.reshape(x, (b, h, w, c), name=name)
  
file_path: tensornets/tensornets/ops.py
imports: from __future__ import absolute_import
  import os
  import tensorflow
  from .utils import ops_to_outputs
  from .version_utils import tf_later_than
label_desc: Use image node_id 4 for calling a global function with example usage: upsample(x, stride, name) and returns: tf