code: def testHash(self):
      a = ops.convert_to_tensor(value=10)
  
      def eager():
          hash(a)
  
      def graph():
          @def_function.function
          def f(x):
              hash(x)
  
          f(a)
  
      for f in [eager, graph]:
          with self.assertRaisesRegexp(
              TypeError,
              r"Tensor is unhashable. Instead, use tensor.ref\(\) as the key.",
          ):
              f()
  
imports: import numpy
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.numpy_ops import np_arrays
  from tensorflow.python.ops.numpy_ops import np_math_ops
  from tensorflow.python.platform import test
  from tensorflow.python.util import nest
label_desc: Use image node_id 25 for calling the ArrayTest obj's underlying member method code with example usage: obj.testHash() without return types