code: def test_GpuCumOp1D(self, mode):
      np_func = dict(add=np.cumsum, mul=np.cumprod)[mode]
      op_class = partial(self.op_class, mode=mode)
      block_max_size = self.max_threads_dim0 * 2
  
      x = T.fvector("x")
      f = theano.function([x], op_class(axis=0)(x), mode=self.mode)
      assert [
          n
          for n in f.maker.fgraph.toposort()
          if isinstance(n.op, GpuCumOp)
      ]
  
      # Extensive testing for the first 1025 sizes
      a = np.random.random(1025).astype("float32")
      for i in xrange(a.shape[0]):
          utt.assert_allclose(np_func(a[:i]), f(a[:i]))
  
      # Use multiple GPU threadblocks
      a = np.random.random((block_max_size + 2,)).astype("float32")
      utt.assert_allclose(np_func(a), f(a))
  
      # Use recursive cumop
      a = np.ones(
          (block_max_size * (block_max_size + 1) + 2,), dtype="float32"
      )
      utt.assert_allclose(np_func(a), f(a))
  
imports: from __future__ import absolute_import, print_function, division
  from functools import partial
  from itertools import product
  import numpy
  from six.moves import xrange
  from theano import tensor
  import theano
  import theano.tensor.tests.test_extra_ops
  from theano.tensor.extra_ops import CumOp
  from theano.tests.unittest_tools import SkipTest
  from theano.tests import unittest_tools
  from .config import mode_with_gpu, test_ctx_name
  from ..extra_ops import GpuCumOp
  from ..type import get_context
label_desc: Use image node_id 8 for calling the TestGpuCumOp obj's underlying member method code with example usage: obj.test_GpuCumOp1D(mode) without return types