code: def test_GpuCrossentropySoftmax1HotWithBiasDx():
      # This is basic test for GpuCrossentropySoftmax1HotWithBiasDx
      # We check that we loop when their is too much threads
  
      batch_size = 4097
      n_out = 1250
  
      if not isinstance(mode_with_gpu, theano.compile.DebugMode):
          n_out = 4099
  
      # Seed numpy.random with config.unittests.rseed
      utt.seed_rng()
  
      softmax_output_value = np.random.rand(batch_size, n_out).astype(
          "float32"
      )
      dnll_value = np.asarray(
          np.random.rand(batch_size), dtype="float32"
      )
      y_idx_value = np.random.randint(low=0, high=5, size=batch_size)
  
      softmax_output = T.fmatrix()
      softmax_output /= softmax_output.sum(axis=1).reshape(
          softmax_output.shape[1], 1
      )
      op = theano.tensor.nnet.crossentropy_softmax_1hot_with_bias_dx(
          dnll_value, softmax_output, y_idx_value
      )
  
      cpu_f = theano.function(
          [softmax_output], op, mode=mode_without_gpu
      )
      gpu_f = theano.function([softmax_output], op, mode=mode_with_gpu)
      # theano.printing.debugprint(cpu_f)
      # theano.printing.debugprint(gpu_f)
  
      assert any(
          [
              isinstance(
                  node.op, T.nnet.CrossentropySoftmax1HotWithBiasDx
              )
              for node in cpu_f.maker.fgraph.toposort()
          ]
      )
      assert any(
          [
              isinstance(node.op, GpuCrossentropySoftmax1HotWithBiasDx)
              for node in gpu_f.maker.fgraph.toposort()
          ]
      )
  
      cpu_out = cpu_f(softmax_output_value)
      gpu_out = gpu_f(softmax_output_value)
  
      rtol = 1e-5
      atol = 1e-6
      utt.assert_allclose(cpu_out, gpu_out, rtol=rtol, atol=atol)
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  import theano
  import theano.tensor
  import theano.tests.unittest_tools
  from .config import mode_with_gpu, mode_without_gpu
  from ..nnet import GpuCrossentropySoftmaxArgmax1HotWithBias, GpuCrossentropySoftmax1HotWithBiasDx, GpuSoftmaxWithBias, GpuSoftmax
label_desc: Use image node_id 2 for calling a global function with example usage: test_GpuCrossentropySoftmax1HotWithBiasDx() without return types