code: def expand_empty(tensor_var, size):
      """
      Transforms the shape of a tensor from (d1, d2 ... ) to ( d1+size, d2, ..)
      by adding uninitialized memory at the end of the tensor.
  
      """
  
      if size == 0:
          return tensor_var
      shapes = [tensor_var.shape[x] for x in xrange(tensor_var.ndim)]
      new_shape = [size + shapes[0]] + shapes[1:]
      empty = tensor.AllocEmpty(tensor_var.dtype)(*new_shape)
  
      ret = tensor.set_subtensor(empty[: shapes[0]], tensor_var)
      ret.tag.nan_guard_mode_check = False
      return ret
  
imports: from __future__ import absolute_import, print_function, division
  import copy
  import logging
  import warnings
  from collections import OrderedDict
  import numpy
  import theano
  from theano.compat import izip
  from six import string_types, iteritems
  from six.moves import xrange
  from theano.compile.pfunc import rebuild_collect_shared
  from theano import gof, compat
  from theano import tensor, scalar
  from theano.tensor.basic import get_scalar_constant_value
label_desc: Use image node_id 9 for calling a global function with example usage: expand_empty(tensor_var, size) and returns: ret, tensor_var