class_docstr: Tests KerasLayer in an all-Keras environment.
class_docstr_tok: ["Tests","KerasLayer","in","an","all-Keras","environment","."]
code: def testOutputShapeList(self, pass_output_shapes):
      export_dir = os.path.join(self.get_temp_dir(), "obscurely-shaped")
      _save_model_with_obscurely_shaped_list_output(export_dir)
  
      kwargs = {}
      if pass_output_shapes:
          kwargs["output_shape"] = [[1], [2, 2], [3, 3, 3]]
      inp = tf_keras_v2.layers.Input(shape=(1,), dtype=tf.float32)
      imported = hub.KerasLayer(export_dir, **kwargs)
      outp = imported(inp)
      model = tf_keras_v2.Model(inp, outp)
  
      x = np.array([[1.0], [10.0]], dtype=np.float32)
      outputs = model(x)
      self.assertLen(outputs, 3)
      single, double, triple = [x.numpy() for x in outputs]
      # The outputs above are eager Tensors with concrete values,
      # so they always have a fully defined shape. However, running
      # without crash verifies that no incompatible shapes were set.
      # See EstimatorTest below for graph-mode Tensors.
      self.assertAllClose(single, np.array([[1.0], [10.0]]))
      self.assertAllClose(
          double,
          np.array(
              [[[2.0, 2.0], [2.0, 2.0]], [[20.0, 20.0], [20.0, 20.0]]]
          ),
      )
      self.assertAllClose(
          triple,
          np.array(
              [
                  [
                      [
                          [3.0, 3.0, 3.0],
                          [3.0, 3.0, 3.0],
                          [3.0, 3.0, 3.0],
                      ],
                      [
                          [3.0, 3.0, 3.0],
                          [3.0, 3.0, 3.0],
                          [3.0, 3.0, 3.0],
                      ],
                      [
                          [3.0, 3.0, 3.0],
                          [3.0, 3.0, 3.0],
                          [3.0, 3.0, 3.0],
                      ],
                  ],
                  [
                      [
                          [30.0, 30.0, 30.0],
                          [30.0, 30.0, 30.0],
                          [30.0, 30.0, 30.0],
                      ],
                      [
                          [30.0, 30.0, 30.0],
                          [30.0, 30.0, 30.0],
                          [30.0, 30.0, 30.0],
                      ],
                      [
                          [30.0, 30.0, 30.0],
                          [30.0, 30.0, 30.0],
                          [30.0, 30.0, 30.0],
                      ],
                  ],
              ]
          ),
      )
      # Test round-trip through config.
      config = imported.get_config()
      new_layer = hub.KerasLayer.from_config(_json_cycle(config))
      if pass_output_shapes:
          self.assertEqual(
              new_layer._output_shape, imported._output_shape
          )
      else:
          self.assertFalse(hasattr(new_layer, "_output_shape"))
  
imports: import json
  import os
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import tensorflow_hub
label_desc: Use image node_id 7 for calling the KerasTest obj's underlying member method code with example usage: obj.testOutputShapeList(pass_output_shapes) without return types