code: def check_expected_values(
      self,
      activations,
      labels,
      input_length,
      expected_costs,
      expected_grads,
  ):
      gpu_train = self.setup_gpu_op(activations, labels, input_length)
      gpu_cost, gpu_grad = gpu_train()
      # Transfer costs from GPU memory to host
      cost_from_gpu = np.asarray(gpu_cost)
      # Transfer gradients from GPU memory to host
      grad_from_gpu = np.asarray(gpu_grad)
      # Check that results are in conformance with expected values
      utt.assert_allclose(
          expected_grads / cost_from_gpu.shape[0], grad_from_gpu
      )
      utt.assert_allclose(expected_costs, cost_from_gpu)
  
imports: from __future__ import division, absolute_import, print_function
  import unittest
  import numpy
  import theano
  import theano.tensor
  from theano.tests import unittest_tools
  import theano.gpuarray
  from theano.gpuarray.ctc import gpu_ctc, GpuConnectionistTemporalClassification
  from theano.tensor.nnet.ctc import ctc, ctc_available, ConnectionistTemporalClassification
  from theano.tensor.nnet.tests.test_ctc import setup_torch_case, setup_ctc_case, setup_grad_case
  from .config import mode_with_gpu, mode_without_gpu
label_desc: Use image node_id 5 for calling the TestCTC obj's underlying member method code with example usage: obj.check_expected_values(activations, labels, input_length, expected_costs, expected_grads) without return types