docstr: Tests that encoder works with stages that need input shape for decode.
  
  This test chains two stages with this property, and provides an input with
  statically unknown shape information.
docstr_tok: ["Tests","that","encoder","works","with","stages","that","need","input","shape","for","decode",".","This","test","chains","two","stages","with","this","property",",","and","provides","an","input","with","statically","unknown","shape","information","."]
code: def test_decode_needs_input_shape_unknown_input_shape(self):
      """Tests that encoder works with stages that need input shape for decode.
  
      This test chains two stages with this property, and provides an input with
      statically unknown shape information.
      """
      encoder = (
          core_encoder.EncoderComposer(
              test_utils.ReduceMeanEncodingStage()
          )
          .add_parent(test_utils.ReduceMeanEncodingStage(), RM_VALS)
          .make()
      )
      x = test_utils.get_tensor_with_random_shape()
      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)
      assert (
          x.shape.as_list()[0] is None
      )  # Validate the premise of the test.
      x, decoded_x = self.evaluate([x, decoded_x])
  
      # Assert shape is correctly recovered, and finctionality is as expected.
      self.assertAllEqual(x.shape, decoded_x.shape)
      self.assertAllClose([x.mean()] * len(x), decoded_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 10 for calling the EncoderTest obj's underlying member method code with example usage: obj.test_decode_needs_input_shape_unknown_input_shape() without return types