code: def test_gpu_contiguous():
      a = T.fmatrix("a")
      i = T.iscalar("i")
      a_val = np.asarray(np.random.rand(4, 5), dtype="float32")
      # The reshape is needed otherwise we make the subtensor on the CPU
      # to transfer less data.
      f = theano.function(
          [a, i],
          gpu_contiguous(a.reshape((5, 4))[::i]),
          mode=mode_with_gpu,
      )
      topo = f.maker.fgraph.toposort()
      assert any([isinstance(node.op, GpuSubtensor) for node in topo])
      assert any([isinstance(node.op, GpuContiguous) for node in topo])
      assert f(a_val, 1).flags.c_contiguous
      assert f(a_val, 2).flags.c_contiguous
      assert f(a_val, 2).flags.c_contiguous
  
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 11 for calling a global function with example usage: test_gpu_contiguous() without return types