class_docstr: Tests for the `common_encoders` methods.
class_docstr_tok: ["Tests","for","the","`","common_encoders","`","methods","."]
code: def test_as_simple_encoder(self, encoder_fn):
      encoder = common_encoders.as_simple_encoder(
          encoder_fn(), tf.TensorSpec((2,), tf.float32)
      )
      self.assertIsInstance(encoder, simple_encoder.SimpleEncoder)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  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 gather_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import simple_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.encoders import common_encoders
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.utils import py_utils
label_desc: Use image node_id 1 for calling the EncoderLibraryTest obj's underlying member method code with example usage: obj.test_as_simple_encoder(encoder_fn) without return types