docstr: Tests adaptive encoding stage with state update tensors.
docstr_tok: ["Tests","adaptive","encoding","stage","with","state","update","tensors","."]
code: def test_adaptive_stage_using_state_update_tensors(self):
      """Tests adaptive encoding stage with state update tensors."""
      encoder = (
          core_encoder.EncoderComposer(
              test_utils.AdaptiveNormalizeEncodingStage()
          )
          .add_parent(test_utils.PlusOneEncodingStage(), P1_VALS)
          .make()
      )
      x = tf.constant(1.0)
      state = encoder.initial_state()
  
      for _ in range(1, 5):
          initial_state = state
          encode_params, decode_params = encoder.get_params(state)
          (
              encoded_x,
              state_update_tensors,
              input_shapes,
          ) = encoder.encode(x, encode_params)
          decoded_x = encoder.decode(
              encoded_x, decode_params, input_shapes
          )
          state = encoder.update_state(
              initial_state, state_update_tensors
          )
          data = self.evaluate(
              test_utils.TestData(
                  x,
                  encoded_x,
                  decoded_x,
                  initial_state,
                  state_update_tensors,
                  state,
              )
          )
  
          self.assertAllClose(data.x, data.decoded_x)
          self.assertLessEqual(
              data.initial_state[CHILDREN][P1_VALS][STATE][
                  AN_FACTOR_STATE
              ],
              1.0,
          )
          self.assertEqual(
              data.state_update_tensors[CHILDREN][P1_VALS][TENSORS][
                  AN_NORM_UPDATE
              ],
              2.0,
          )
          self.assertLessEqual(data.encoded_x[P1_VALS][AN_VALS], 2.0)
  
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 14 for calling the EncoderTest obj's underlying member method code with example usage: obj.test_adaptive_stage_using_state_update_tensors() without return types