docstr: Tests that the same encoder can be used to encode multiple objects.
docstr_tok: ["Tests","that","the","same","encoder","can","be","used","to","encode","multiple","objects","."]
code: def test_encoder_is_reusable(self):
      """Tests that the same encoder can be used to encode multiple objects."""
      encoder = (
          core_encoder.EncoderComposer(
              test_utils.PlusOneEncodingStage()
          )
          .add_parent(test_utils.TimesTwoEncodingStage(), T2_VALS)
          .make()
      )
      x_vals = [
          tf.random.normal(shape) for shape in [(3,), (3, 4), (3, 4, 5)]
      ]
      for x in x_vals:
          encode_params, decode_params = encoder.get_params(
              encoder.initial_state()
          )
          encoded_x, _, input_shapes = encoder.encode(x, encode_params)
          decoded_x = encoder.decode(
              encoded_x, decode_params, input_shapes
          )
          x, encoded_x, decoded_x = self.evaluate(
              [x, encoded_x, decoded_x]
          )
  
          self.assertAllClose(x, decoded_x)
          self.assertAllClose(
              {T2_VALS: {P1_VALS: x * 2.0 + 1.0}}, encoded_x
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import core_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import encoding_stage
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 12 for calling the EncoderTest obj's underlying member method code with example usage: obj.test_encoder_is_reusable() without return types