Rename name->qualname in torch.library.impl_abstract (#111380)

See title. Makes this consistent with torch.library.{define, impl, impl_device}, where we have named the same argument `qualname`. This is not BC-breaking because we have not released a version of PyTorch with impl_abstract in it yet.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111380
Approved by: https://github.com/soulitzer
This commit is contained in:
Richard Zou 2023-10-23 14:43:39 -04:00 committed by PyTorch MergeBot
parent 0be84bb41e
commit 6463f2b51c

View File

@ -293,7 +293,7 @@ def _(lib: Library, name, dispatch_key=""):
def impl_abstract(name, func=None, *, lib=None, _stacklevel=1):
def impl_abstract(qualname, func=None, *, lib=None, _stacklevel=1):
r"""Register an abstract implementation for this operator.
An "abstract implementation" specifies the behavior of this operator on
@ -362,7 +362,7 @@ def impl_abstract(name, func=None, *, lib=None, _stacklevel=1):
source = torch._library.utils.get_source(_stacklevel + 1)
def inner(func):
entry = torch._library.simple_registry.singleton.find(name)
entry = torch._library.simple_registry.singleton.find(qualname)
handle = entry.abstract_impl.register(func, source)
if lib is not None:
lib._registration_handles.append(handle)