xref: /aosp_15_r20/external/pytorch/torchgen/api/meta.py (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1from torchgen.model import NativeFunctionsGroup
2
3
4# Follows dispatcher calling convention, but:
5#   - Mutable arguments not allowed.  Meta functions are always
6#     written in functional form.  Look at FunctionSchema.signature()
7#   - No tensor returns; instead we return a TensorMeta describing
8#     the tensor in question
9
10
11def name(g: NativeFunctionsGroup) -> str:
12    # use the overload name from the functional version
13    return str(g.functional.func.name).replace(".", "_")
14