class_docstr: Adaptive version of the `EncodingStageInterface`.
  
  This class has the same functionality as the `EncodingStageInterface`, but in
  addition maintains a state, which is adaptive based on the values being
  compressed and can parameterize the way encoding functionality works. Note
  that this is useful only in case where the encoding is executed in multiple
  iterations.
  
  A typical implementation of this interface would be a wrapper of an
  implementation of `EncodingStageInterface, which uses the existing stateless
  transformations and adds state that controls some of the parameters returned
  by the `get_params` method.
  
  The important distinction is that in addition to `encoded_tensors`, the
  `encode` method of this class returns an additional dictionary of
  `state_update_tensors`. The `commutes_with_sum` property talks about summation
  of only the `encoded_tensors`. The `state_update_tensors` can be aggregated
  in more flexible ways, specified by the `state_update_aggregation_modes`
  property, before being passed to the `update_state` method.
  
  Each implementation should also be wrapped by `tf_style_encoding_stage` to
  ensure adherence to the TensorFlow style guide. The adherence is enforced by
  the `BaseEncodingStageTest` test class. See `test_utils.py` for more details.
docstr: `True/False` based on whether the encoding commutes with sum.
  
  Iff `True`, it means that given multiple inputs `x` with the same `shape`
  and `dtype`, and the same `params` argument of the `encode` method, the
  implementation is such that every value in the returned `encoded_tensors`
  can be first summed, before being passed to the decoding functionality, and
  the output should be identical (up to numerical precision) to summing the
  fully decoded `Tensor` objects.
  
  Note that this also assumes that each of the `decode` methods would be used
  with the same values of `decode_params`.
  
  Returns:
    A boolean, `True` iff the encoding commutes with sum.
docstr_tok: ["`","True\/False","`","based","on","whether","the","encoding","commutes","with","sum",".","Iff","`","True","`",",","it","means","that","given","multiple","inputs","`","x","`","with","the","same","`","shape","`","and","`","dtype","`",",","and","the","same","`","params","`","argument","of","the","`","encode","`","method",",","the","implementation","is","such","that","every","value","in","the","returned","`","encoded_tensors","`","can","be","first","summed",",","before","being","passed","to","the","decoding","functionality",",","and","the","output","should","be","identical","(","up","to","numerical","precision",")","to","summing","the","fully","decoded","`","Tensor","`","objects",".","Note","that","this","also","assumes","that","each","of","the","`","decode","`","methods","would","be","used","with","the","same","values","of","`","decode_params","`",".","Returns",":","A","boolean",",","`","True","`","iff","the","encoding","commutes","with","sum","."]
code: def commutes_with_sum(self):
      """`True/False` based on whether the encoding commutes with sum.
  
      Iff `True`, it means that given multiple inputs `x` with the same `shape`
      and `dtype`, and the same `params` argument of the `encode` method, the
      implementation is such that every value in the returned `encoded_tensors`
      can be first summed, before being passed to the decoding functionality, and
      the output should be identical (up to numerical precision) to summing the
      fully decoded `Tensor` objects.
  
      Note that this also assumes that each of the `decode` methods would be used
      with the same values of `decode_params`.
  
      Returns:
        A boolean, `True` iff the encoding commutes with sum.
      """
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import enum
  import six
  import tensorflow
label_desc: Use image node_id 3 for calling the AdaptiveEncodingStageInterface obj's underlying member method code with example usage: obj.commutes_with_sum() without return types