code: def testConvertToTensorOfCorrectDtype(self):
      indices = [0, 1, 2]
      depth = 3
      dtype = np.float16
      truth = np.asarray([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
      self._testBothOneHot(
          truth=truth,
          indices=indices,
          depth=depth,
          on_value=1.0,
          off_value=constant_op.constant(0.0, dtype),
          dtype=dtype,
      )
  
      self._testBothOneHot(
          truth=truth,
          indices=indices,
          depth=depth,
          on_value=constant_op.constant(1.0, dtype),
          off_value=0.0,
          dtype=dtype,
      )
  
      self._testBothOneHot(
          truth=truth,
          indices=indices,
          depth=depth,
          on_value=1.0,
          off_value=0.0,
          dtype=dtype,
      )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 19 for calling the OneHotTest obj's underlying member method code with example usage: obj.testConvertToTensorOfCorrectDtype() without return types