ai-content-maker/.venv/Lib/site-packages/torchgen/api/meta.py

13 lines
482 B
Python
Raw Normal View History

2024-05-03 04:18:51 +03:00
from torchgen.model import NativeFunctionsGroup
# Follows dispatcher calling convention, but:
# - Mutable arguments not allowed. Meta functions are always
# written in functional form. Look at FunctionSchema.signature()
# - No tensor returns; instead we return a TensorMeta describing
# the tensor in question
def name(g: NativeFunctionsGroup) -> str:
# use the overload name from the functional version
return str(g.functional.func.name).replace(".", "_")