code: def test_gpujoin_gpualloc():
      a = T.fmatrix("a")
      a_val = np.asarray(np.random.rand(4, 5), dtype="float32")
      b = T.fmatrix("b")
      b_val = np.asarray(np.random.rand(3, 5), dtype="float32")
  
      f = theano.function(
          [a, b],
          T.join(0, T.zeros_like(a), T.ones_like(b)) + 4,
          mode=mode_without_gpu,
      )
      f_gpu = theano.function(
          [a, b],
          T.join(0, T.zeros_like(a), T.ones_like(b)),
          mode=mode_with_gpu,
      )
      f_gpu2 = theano.function(
          [a, b],
          T.join(0, T.zeros_like(a), T.ones_like(b)) + 4,
          mode=mode_with_gpu,
      )
      assert (
          sum(
              [node.op == T.alloc for node in f.maker.fgraph.toposort()]
          )
          == 2
      )
      assert (
          sum(
              [node.op == T.join_ for node in f.maker.fgraph.toposort()]
          )
          == 1
      )
      assert (
          sum(
              [
                  isinstance(node.op, GpuAlloc)
                  for node in f_gpu.maker.fgraph.toposort()
              ]
          )
          == 2
      )
      assert (
          sum(
              [
                  node.op == gpu_join
                  for node in f_gpu.maker.fgraph.toposort()
              ]
          )
          == 1
      )
      assert (
          sum(
              [
                  isinstance(node.op, GpuAlloc)
                  for node in f_gpu2.maker.fgraph.toposort()
              ]
          )
          == 2
      )
      assert (
          sum(
              [
                  node.op == gpu_join
                  for node in f_gpu2.maker.fgraph.toposort()
              ]
          )
          == 1
      )
      assert np.allclose(f(a_val, b_val), f_gpu2(a_val, b_val))
  
imports: from __future__ import absolute_import, print_function, division
  import unittest
  from theano.compat import izip
  from six import iteritems
  import numpy
  import theano
  import theano.tensor
  from theano.tensor import TensorType
  from theano.tensor.basic import alloc
  from theano.tensor.tests import test_basic
  from theano.tensor.tests.test_basic import rand, safe_make_node
  from theano.tests import unittest_tools
  from ..type import GpuArrayType, get_context, gpuarray_shared_constructor
  from ..basic_ops import host_from_gpu, HostFromGpu, GpuFromHost, GpuReshape, GpuToGpu, GpuAlloc, GpuAllocEmpty, GpuContiguous, gpu_join, GpuJoin, GpuSplit, GpuEye, GpuTri, gpu_contiguous
  from ..elemwise import GpuDimShuffle, GpuElemwise
  from ..subtensor import GpuSubtensor
  from .config import mode_with_gpu, mode_without_gpu, test_ctx_name
  from pygpu import gpuarray
label_desc: Use image node_id 12 for calling a global function with example usage: test_gpujoin_gpualloc() without return types