def _decrease_input_degree(layer):
            """
            Helper routine to reduce degree input nodes for given layer
            """
            for _input in layer.input:
                out_degree[_input] -= 1
                if out_degree[_input] == 0:
                    del out_degree[_input]

            Helper routine to reduce degree input nodes for given layer
            
coremltools/converters/mil/backend/nn/passes/mlmodel_passes.py