docstr: Tests that only TensorFlow values are exposed to users.
docstr_tok: ["Tests","that","only","TensorFlow","values","are","exposed","to","users","."]
code: def test_python_constants_not_exposed(self):
      """Tests that only TensorFlow values are exposed to users."""
      x = tf.constant(1.0)
      tensorspec = tf.TensorSpec.from_tensor(x)
      encoder_py = simple_encoder.SimpleEncoder(
          core_encoder.EncoderComposer(
              test_utils.SimpleLinearEncodingStage(2.0, 3.0)
          ).make(),
          tensorspec,
      )
      a_var = tf.compat.v1.get_variable("a_var", initializer=2.0)
      b_var = tf.compat.v1.get_variable("b_var", initializer=3.0)
      encoder_tf = simple_encoder.SimpleEncoder(
          core_encoder.EncoderComposer(
              test_utils.SimpleLinearEncodingStage(a_var, b_var)
          ).make(),
          tensorspec,
      )
  
      state_py = encoder_py.initial_state()
      state_tf = encoder_tf.initial_state()
      iteration_py = _make_iteration_function(encoder_py)
      iteration_tf = _make_iteration_function(encoder_tf)
  
      self.evaluate(tf.compat.v1.global_variables_initializer())
      _, encoded_x_py, decoded_x_py, _ = self.evaluate(
          iteration_py(x, state_py)
      )
      _, encoded_x_tf, decoded_x_tf, _ = self.evaluate(
          iteration_tf(x, state_tf)
      )
  
      # The encoded_x_tf should have two elements that encoded_x_py does not.
      # These correspond to the two variables created passed on to constructor of
      # encoder_tf, which are exposed as params. For encoder_py, these are python
      # integers, and should thus be hidden from users.
      self.assertLen(encoded_x_tf, len(encoded_x_py) + 2)
  
      # Make sure functionality is still the same.
      self.assertAllClose(x, decoded_x_tf)
      self.assertAllClose(x, decoded_x_py)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import tensorflow
  from tensorflow.python.framework import test_util
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import core_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import simple_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 4 for calling the SimpleEncoderTest obj's underlying member method code with example usage: obj.test_python_constants_not_exposed() without return types