code: def _meshgrid(height, width):
      # This function is the grid generator from eq. (1) in reference [1].
      # It is equivalent to the following numpy code:
      #  x_t, y_t = np.meshgrid(np.linspace(-1, 1, width),
      #                         np.linspace(-1, 1, height))
      #  ones = np.ones(np.prod(x_t.shape))
      #  grid = np.vstack([x_t.flatten(), y_t.flatten(), ones])
      # It is implemented in Theano instead to support symbolic grid sizes.
      # Note: If the image size is known at layer construction time, we could
      # compute the meshgrid offline in numpy instead of doing it dynamically
      # in Theano. However, it hardly affected performance when we tried.
      x_t = T.dot(
          T.ones((height, 1)),
          _linspace(-1.0, 1.0, width).dimshuffle("x", 0),
      )
      y_t = T.dot(
          _linspace(-1.0, 1.0, height).dimshuffle(0, "x"),
          T.ones((1, width)),
      )
  
      x_t_flat = x_t.reshape((1, -1))
      y_t_flat = y_t.reshape((1, -1))
      ones = T.ones_like(x_t_flat)
      grid = T.concatenate([x_t_flat, y_t_flat, ones], axis=0)
      return grid
  
imports: import theano
  import theano.tensor
  import numpy
  from ..None import init
  from ..None import nonlinearities
  from ..utils import as_tuple, floatX, int_types
  from ..random import get_rng
  from .base import Layer, MergeLayer
  from theano.sandbox.rng_mrg import MRG_RandomStreams
label_desc: Use image node_id 5 for calling a global function with example usage: _meshgrid(height, width) and returns: grid