code: def test_hostfromgpu_shape_i():
      # Test that the shape is lifted over hostfromgpu
  
      m = mode_with_gpu.including(
          "local_dot_to_dot22",
          "local_dot22_to_dot22scalar",
          "specialize",
      )
      a = T.fmatrix("a")
      ca = theano.gpuarray.type.GpuArrayType(
          "float32", (False, False)
      )()
      av = np.asarray(np.random.rand(5, 4), dtype="float32")
      cv = gpuarray.asarray(
          np.random.rand(5, 4),
          dtype="float32",
          context=get_context(test_ctx_name),
      )
  
      f = theano.function([a], GpuFromHost(test_ctx_name)(a), mode=m)
      assert any(
          isinstance(x.op, GpuFromHost)
          for x in f.maker.fgraph.toposort()
      )
      f = theano.function(
          [a], GpuFromHost(test_ctx_name)(a).shape, mode=m
      )
      topo = f.maker.fgraph.toposort()
      assert isinstance(topo[0].op, T.opt.Shape_i)
      assert isinstance(topo[1].op, T.opt.Shape_i)
      assert isinstance(topo[2].op, T.opt.MakeVector)
      assert tuple(f(av)) == (5, 4)
  
      f = theano.function([ca], host_from_gpu(ca), mode=m)
      assert host_from_gpu in [x.op for x in f.maker.fgraph.toposort()]
      f = theano.function([ca], host_from_gpu(ca).shape, mode=m)
      topo = f.maker.fgraph.toposort()
      assert isinstance(topo[0].op, theano.compile.Shape_i)
      assert isinstance(topo[1].op, theano.compile.Shape_i)
      assert isinstance(topo[2].op, theano.tensor.opt.MakeVector)
      assert tuple(f(cv)) == (5, 4)
  
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 14 for calling a global function with example usage: test_hostfromgpu_shape_i() without return types