code: def test_gpuarray_shared_scalar():
      # By default, we don't put scalar as shared variable on the GPU
      nose.tools.assert_raises(
          TypeError,
          gpuarray_shared_constructor,
          np.asarray(1, dtype="float32"),
      )
  
      # But we can force that
      gpuarray_shared_constructor(
          np.asarray(1, dtype="float32"), target=test_ctx_name
      )
  
imports: from __future__ import absolute_import, print_function, division
  import os
  import nose
  import numpy
  import theano
  from theano.compat import PY3
  from theano import config
  from theano.compile import DeepCopyOp, Rebroadcast, ViewOp
  from theano.misc.pkl_utils import CompatUnpickler
  from .config import test_ctx_name
  from .test_basic_ops import rand_gpuarray
  from ..type import GpuArrayType, gpuarray_shared_constructor
  import pygpu
label_desc: Use image node_id 8 for calling a global function with example usage: test_gpuarray_shared_scalar() without return types