(model: onnx.ModelProto, skip_fuse_bn: bool, skipped_optimizers: Optional[Sequence[str]])
return model
:param model: The onnx model.
    :return: The optimized onnx model.
    Before simplifying, use this method to generate value_info, which is used in `forward_all`
    After simplifying, use this method to fold constants generated in previous step into initializer,
    and eliminate unused constants.
:param model: The onnx model.
    :return: The optimized onnx model.
    Before simplifying, use this method to generate value_info, which is used in `forward_all`
    After simplifying, use this method to fold constants generated in previous step into initializer,
    and eliminate unused constants.
: param model : The onnx model . : return : The optimized onnx model . Before simplifying use this method to generate value_info which is used in forward_all After simplifying use this method to fold constants generated in previous step into initializer and eliminate unused constants .
def optimize(model: onnx.ModelProto, skip_fuse_bn: bool, skipped_optimizers: Optional[Sequence[str]]) -> onnx.ModelProto:
    """
    :param model: The onnx model.
    :return: The optimized onnx model.
    Before simplifying, use this method to generate value_info, which is used in `forward_all`
    After simplifying, use this method to fold constants generated in previous step into initializer,
    and eliminate unused constants.
    """

    onnx.checker.check_model(model)
    onnx.helper.strip_doc_string(model)
    optimizers_list = onnxoptimizer.get_fuse_and_elimination_passes()
    if skip_fuse_bn:
        optimizers_list.remove('fuse_bn_into_conv')
    if skipped_optimizers is not None:
        for opt in skipped_optimizers:
            try:
                optimizers_list.remove(opt)
            except ValueError:
                pass

    model = onnxoptimizer.optimize(model, optimizers_list,
                                   fixed_point=True)
    onnx.checker.check_model(model)
    return model
def optimize ( model : onnx . ModelProto , skip_fuse_bn : bool , skipped_optimizers : Optional [ Sequence [ str ] ] ) -> onnx . ModelProto : onnx . checker . check_model ( model ) onnx . helper . strip_doc_string ( model ) optimizers_list = onnxoptimizer . get_fuse_and_elimination_passes ( ) if skip_fuse_bn : optimizers_list . remove ( 'fuse_bn_into_conv' ) if skipped_optimizers is not None : for opt in skipped_optimizers : try : optimizers_list . remove ( opt ) except ValueError : pass model = onnxoptimizer . optimize ( model , optimizers_list , fixed_point = True ) onnx . checker . check_model ( model ) return model