docstr: Tests that encode/decode input signature is enforced.
docstr_tok: ["Tests","that","encode\/decode","input","signature","is","enforced","."]
code: def test_input_signature_enforced(self):
      """Tests that encode/decode input signature is enforced."""
      x = tf.constant(1.0)
      encoder = simple_encoder.SimpleEncoder(
          core_encoder.EncoderComposer(
              test_utils.PlusOneOverNEncodingStage()
          ).make(),
          tf.TensorSpec.from_tensor(x),
      )
  
      state = encoder.initial_state()
      with self.assertRaises((TypeError, ValueError)):
          bad_x = tf.stack([x, x])
          encoder.encode(bad_x, state)
      with self.assertRaises((TypeError, ValueError)):
          bad_state = state + (x,)
          encoder.encode(x, bad_state)
      encoded_x = encoder.encode(x, state)
      with self.assertRaises(ValueError):
          bad_encoded_x = dict(encoded_x)
          bad_encoded_x.update({"x": x})
          encoder.decode(bad_encoded_x)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import tensorflow
  from tensorflow.python.framework import test_util
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import core_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import simple_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 7 for calling the SimpleEncoderTest obj's underlying member method code with example usage: obj.test_input_signature_enforced() without return types