docstr: Tests that fully commutes with sum property works.
docstr_tok: ["Tests","that","fully","commutes","with","sum","property","works","."]
code: def test_full_commutativity_with_sum(self):
      """Tests that fully commutes with sum property works."""
      spec = tf.TensorSpec((2,), tf.float32)
  
      encoder = gather_encoder.GatherEncoder.from_encoder(
          core_encoder.EncoderComposer(
              test_utils.TimesTwoEncodingStage()
          ).make(),
          spec,
      )
      self.assertTrue(encoder.fully_commutes_with_sum)
  
      encoder = gather_encoder.GatherEncoder.from_encoder(
          core_encoder.EncoderComposer(
              test_utils.TimesTwoEncodingStage()
          )
          .add_parent(test_utils.TimesTwoEncodingStage(), T2_VALS)
          .make(),
          spec,
      )
      self.assertTrue(encoder.fully_commutes_with_sum)
  
      encoder = core_encoder.EncoderComposer(
          test_utils.SignIntFloatEncodingStage()
      )
      encoder.add_child(test_utils.TimesTwoEncodingStage(), SIF_SIGNS)
      encoder.add_child(test_utils.PlusOneEncodingStage(), SIF_INTS)
      encoder.add_child(
          test_utils.TimesTwoEncodingStage(), SIF_FLOATS
      ).add_child(test_utils.PlusOneOverNEncodingStage(), T2_VALS)
      encoder = gather_encoder.GatherEncoder.from_encoder(
          encoder.make(), spec
      )
      self.assertFalse(encoder.fully_commutes_with_sum)
  
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 7 for calling the GatherEncoderTest obj's underlying member method code with example usage: obj.test_full_commutativity_with_sum() without return types