Fix ArgAnnotation with boolean flag which instructs value semantics (#3238)

pull/3158/merge
Yuanqiang Liu 2024-04-28 02:24:55 +08:00 committed by GitHub
parent 4fbe77a051
commit 695458daea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ def export(fn):
return fn
ArgAnnotation = Tuple[List[int], torch.dtype]
ArgAnnotation = Tuple[List[int], torch.dtype, bool]
# TODO: Replace with py3 extended argument annotations when available.
@ -55,9 +55,9 @@ def annotate_args(annotations: List[Optional[ArgAnnotation]]):
The `annotations` should be a list of the same length as the number of
argument to the method (including `self`). Each list entry is either:
- None, corresponding to providing the compiler with no information.
- A 2-tuple consisting of a shape and a dtype, such as
`([2, 3, 4], torch.float32)`. A dimension with an unknown size can be
indicated by using `-1` as the size. This provides the compiler a
- A 3-tuple consisting of a shape, a dtype and a flag of value semantics,
such as `([2, 3, 4], torch.float32, True)`. A dimension with an unknown size
can be indicated by using `-1` as the size. This provides the compiler a
guarantee that the argument will always dynamically have the described
shape and dtype.
"""