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_fn = lambda: tf.constant(1.0)
      tensorspec = tf.TensorSpec.from_tensor(x_fn())
      encoder_py = gather_encoder.GatherEncoder.from_encoder(
          core_encoder.EncoderComposer(
              test_utils.SimpleLinearEncodingStage(2.0, 3.0)
          )
          .add_parent(test_utils.PlusOneEncodingStage(), P1_VALS)
          .add_parent(
              test_utils.SimpleLinearEncodingStage(2.0, 3.0), SL_VALS
          )
          .make(),
          tensorspec,
      )
      a_var = tf.Variable(2.0, name="a_var")
      b_var = tf.Variable(3.0, name="b_var")
      encoder_tf = gather_encoder.GatherEncoder.from_encoder(
          core_encoder.EncoderComposer(
              test_utils.SimpleLinearEncodingStage(a_var, b_var)
          )
          .add_parent(test_utils.PlusOneEncodingStage(), P1_VALS)
          .add_parent(
              test_utils.SimpleLinearEncodingStage(a_var, b_var),
              SL_VALS,
          )
          .make(),
          tensorspec,
      )
  
      (
          encode_params_py,
          decode_before_sum_params_py,
          decode_after_sum_params_py,
      ) = encoder_py.get_params()
      (
          encode_params_tf,
          decode_before_sum_params_tf,
          decode_after_sum_params_tf,
      ) = encoder_tf.get_params()
  
      # Params that are Python constants -- not tf.Tensors -- should be hidden
      # from the user, and made statically available at appropriate locations.
      self.assertLen(encode_params_py, 1)
      self.assertLen(encode_params_tf, 5)
      self.assertLen(decode_before_sum_params_py, 1)
      self.assertLen(decode_before_sum_params_tf, 3)
      self.assertEmpty(decode_after_sum_params_py)
      self.assertLen(decode_after_sum_params_tf, 2)
  
imports: import collections
  from absl.testing import parameterized
  import numpy
  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 encoding_stage
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import gather_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 4 for calling the GatherEncoderTest obj's underlying member method code with example usage: obj.test_python_constants_not_exposed() without return types