code: def test_tensor_float16(self):
      x = tensor.tensor4()
      np_x = np.arange(30107).reshape(7, 11, 17, 23).astype("float16")
      for offset, axis1, axis2 in [
          (1, 0, 1),
          (-1, 0, 1),
          (0, 1, 0),
          (-2, 1, 0),
          (-3, 1, 0),
          (-2, 2, 0),
          (3, 3, 0),
          (-1, 3, 2),
          (2, 2, 3),
          (-1, 2, 1),
          (1, 3, 1),
          (-1, 1, 3),
      ]:
          assert np.allclose(
              GpuExtractDiag(offset, axis1, axis2)(x).eval({x: np_x}),
              np_x.diagonal(offset, axis1, axis2),
          )
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  import theano
  from theano import tensor
  from theano.compile import DeepCopyOp
  from theano.tensor.tests import test_subtensor, test_basic
  from theano.tests import unittest_tools
  from ..basic_ops import HostFromGpu, GpuFromHost, GpuContiguous
  from ..elemwise import GpuDimShuffle
  from ..subtensor import GpuIncSubtensor, GpuSubtensor, GpuAdvancedSubtensor1, GpuAdvancedSubtensor, GpuAdvancedBooleanSubtensor, GpuAdvancedIncSubtensor, GpuAdvancedIncSubtensor1, GpuAdvancedIncSubtensor1_dev20, GpuExtractDiag, GpuAllocDiag
  from ..type import gpuarray_shared_constructor
  from .config import mode_with_gpu, test_ctx_name
label_desc: Use image node_id 4 for calling the test_gpuextractdiag obj's underlying member method code with example usage: obj.test_tensor_float16() without return types