meta.py 482 B

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