def acc_replace_mul_ops(
    module: torch.fx.GraphModule,
) -> torch.fx.GraphModule:
    """
    Put constant at the end of multiplicaiton, i.e change 15*x.size(1) to x.size(1)*15.
    """
    for n in module.graph.nodes:
        if n.op == "call_function" and n.target == acc_ops.mul:
            if isinstance(n.kwargs["input"], int):
                node = n
                with module.graph.inserting_after(node):
                    new_kargs = {}
                    new_kargs["input"] = node.kwargs["other"]
                    new_kargs["other"] = node.kwargs["input"]
                    new_node = module.graph.create_node(
                        "call_function",
                        acc_ops.mul,
                        args=node.args,
                        kwargs=new_kargs,
                    )
                    node.replace_all_uses_with(new_node)
                    module.graph.erase_node(node)
    module.graph.eliminate_dead_code()
    module.recompile()
    return module
Put constant at the end of multiplicaiton, i.e change 15*x.size(1) to x.size(1)*15.
fx2ait/fx2ait/passes/lower_basic_pass_aten.py