class_docstr: Test for utilities created in core_encoder.py.
code: def test_split_shapes_by_commuting_structure(self):
      commuting_structure = _get_test_commuting_structure()
      shapes = {
          SHAPE: (5, 5),
          CHILDREN: {
              "key_1": {
                  SHAPE: None,
                  CHILDREN: {"key_4": {SHAPE: (1, 4), CHILDREN: {}}},
              },
              "key_2": {
                  SHAPE: (1, 2),
                  CHILDREN: {},
              },
              "key_3": {
                  SHAPE: (1, 3),
                  CHILDREN: {},
              },
          },
      }
      expected_before_sum_shapes = {
          SHAPE: None,
          CHILDREN: {
              "key_1": {
                  SHAPE: None,
                  CHILDREN: {"key_4": {SHAPE: (1, 4), CHILDREN: {}}},
              },
              "key_2": {
                  SHAPE: (1, 2),
                  CHILDREN: {},
              },
              "key_3": {
                  SHAPE: None,
                  CHILDREN: {},
              },
          },
      }
      expected_after_sum_shapes = {
          SHAPE: (5, 5),
          CHILDREN: {
              "key_1": {
                  SHAPE: None,
                  CHILDREN: {"key_4": {SHAPE: None, CHILDREN: {}}},
              },
              "key_2": {
                  SHAPE: None,
                  CHILDREN: {},
              },
              "key_3": {
                  SHAPE: (1, 3),
                  CHILDREN: {},
              },
          },
      }
  
      (
          before_sum_shapes,
          after_sum_shapes,
      ) = core_encoder.split_shapes_by_commuting_structure(
          shapes, commuting_structure
      )
      self.assertEqual(expected_before_sum_shapes, before_sum_shapes)
      self.assertEqual(expected_after_sum_shapes, after_sum_shapes)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import numpy
  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 encoding_stage
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 2 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_split_shapes_by_commuting_structure() without return types