MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / rename_imported_op

Function rename_imported_op

fastdeploy/import_ops.py:51–63  ·  view source on GitHub ↗

Renames an imported operation in the global namespace. Args: old_name (str): The original name of the operation in the global namespace. new_name (str): The new name to be given to the operation. global_ns (dict): The global namespace where the operation is stored.

(old_name, new_name, global_ns)

Source from the content-addressed store, hash-verified

49
50
51def rename_imported_op(old_name, new_name, global_ns):
52 """
53 Renames an imported operation in the global namespace.
54
55 Args:
56 old_name (str): The original name of the operation in the global namespace.
57 new_name (str): The new name to be given to the operation.
58 global_ns (dict): The global namespace where the operation is stored.
59 """
60 if old_name not in global_ns:
61 return
62 global_ns[new_name] = global_ns[old_name]
63 del global_ns[old_name]
64
65
66def wrap_unified_op(original_cpp_ext_op, original_custom_op):

Callers 3

__init__.pyFile · 0.90
__init__.pyFile · 0.90
__init__.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected