code: def test_overflow_gpu_new_backend():
      seed = 12345
      n_substreams = 7
      curr_rstate = np.array([seed] * 6, dtype="int32")
      rstate = [curr_rstate.copy()]
      for j in range(1, n_substreams):
          rstate.append(rng_mrg.ff_2p72(rstate[-1]))
      rstate = np.asarray(rstate)
      rstate = gpuarray_shared_constructor(rstate)
      fct = functools.partial(
          GPUA_mrg_uniform.new, rstate, ndim=None, dtype="float32"
      )
      # should raise error as the size overflows
      sizes = [
          (2**31,),
          (2**32,),
          (
              2**15,
              2**16,
          ),
          (2, 2**15, 2**15),
      ]
      rng_mrg_overflow(sizes, fct, mode, should_raise_error=True)
      # should not raise error
      sizes = [(2**5,), (2**5, 2**5), (2**5, 2**5, 2**5)]
      rng_mrg_overflow(sizes, fct, mode, should_raise_error=False)
      # should support int32 sizes
      sizes = [
          (np.int32(2**10),),
          (np.int32(2), np.int32(2**10), np.int32(2**10)),
      ]
      rng_mrg_overflow(sizes, fct, mode, should_raise_error=False)
  
file_path: Theano/theano/gpuarray/tests/test_rng_mrg.py
imports: from __future__ import absolute_import, print_function, division
  import functools
  import numpy
  import theano
  from theano import change_flags, tensor
  from theano.sandbox import rng_mrg
  from theano.sandbox.rng_mrg import MRG_RandomStreams
  from theano.sandbox.tests.test_rng_mrg import java_samples, rng_mrg_overflow
  from theano.sandbox.tests.test_rng_mrg import test_f16_nonzero
  from theano.tests import unittest_tools
  from .config import mode_with_gpu
  from ..type import gpuarray_shared_constructor
  from ..rng_mrg import GPUA_mrg_uniform
label_desc: Use image node_id 4 for calling a global function with example usage: test_overflow_gpu_new_backend() without return types