code: def test_encode_unsupported_type_raises(self, dtype):
      stage = self.default_encoding_stage()
      with self.assertRaisesRegexp(
          TypeError, "Unsupported packing type"
      ):
          self.run_one_to_many_encode_decode(
              stage, lambda: tf.cast(self.default_input(), dtype)
          )
  
imports: import itertools
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.stages import stages_impl
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 9 for calling the BitpackingEncodingStageTest obj's underlying member method code with example usage: obj.test_encode_unsupported_type_raises(dtype) without return types