pytorch/torchgen
Aaron Orenstein 732b4e9074 Fix generated vararg types (#128648)
In the generated files torchgen is incorrectly generating types on the varargs.

The changes all look like this (changing `*size: _int` to `*size: Union[_int, SymInt]`):
```
--- ./torch/_VF.pyi.sav	2024-06-13 20:36:49.189664629 -0700
+++ ./torch/_VF.pyi	2024-06-13 20:36:57.208894614 -0700
@@ -168,17 +168,17 @@
 @overload
 def _efficientzerotensor(size: Sequence[Union[_int, SymInt]], *, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: ...
 @overload
-def _efficientzerotensor(*size: _int, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: ...
+def _efficientzerotensor(*size: Union[_int, SymInt], dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: ...
 def _embedding_bag(weight: Tensor, indices: Tensor, offsets: Tensor, scale_grad_by_freq: _bool = False, mode: _int = 0, sparse: _bool = False, per_sample_weights: Optional[Tensor] = None, include_last_offset: _bool = False, padding_idx: _int = -1) -> Tuple[Tensor, Tensor, Tensor, Tensor]: ...
 def _embedding_bag_forward_only(weight: Tensor, indices: Tensor, offsets: Tensor, scale_grad_by_freq: _bool = False, mode: _int = 0, sparse: _bool = False, per_sample_weights: Optional[Tensor] = None, include_last_offset: _bool = False, padding_idx: _int = -1) -> Tuple[Tensor, Tensor, Tensor, Tensor]: ...
 @overload
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/128648
Approved by: https://github.com/jamesjwu
2024-06-14 16:04:37 +00:00
..
aoti [AOTI] Add more fallback ops (#126720) 2024-05-24 19:10:33 +00:00
api Fix generated vararg types (#128648) 2024-06-14 16:04:37 +00:00
decompositions Use strict to toggle strict options in MYPYSTRICT (#118479) 2024-01-28 19:22:22 +00:00
dest [8/N] Remove unused functions (#128499) 2024-06-13 01:15:11 +00:00
executorch [BE]: TRY002 - Ban raising vanilla exceptions (#124570) 2024-04-21 22:26:40 +00:00
fuse Add mm_pattern and bmm_pattern to serialized_patterns (#121313) 2024-04-09 19:42:19 +00:00
operator_versions [BE]: Apply ruff FURB 118. (#124743) 2024-04-26 14:34:52 +00:00
selective_build [BE]: TRY002 - Ban raising vanilla exceptions (#124570) 2024-04-21 22:26:40 +00:00
shape_functions [BE]: TRY002 - Ban raising vanilla exceptions (#124570) 2024-04-21 22:26:40 +00:00
static_runtime [Static Runtime] Fix & run gen_static_runtime_ops (#128299) 2024-06-11 16:27:39 +00:00
__init__.py
BUCK.oss
BUILD.bazel
build.bzl update rules_python and let bazel install its own pip dependencies (#101405) 2023-05-23 06:20:33 +00:00
code_template.py [BE] Enable ruff's UP rules and autoformat torchgen/ (#105423) 2023-07-18 06:44:20 +00:00
context.py [Specialized Kernel] Propagate Specialized Kernel Support through ComputeCodegenUnboxedKernels (#103113) 2023-06-14 10:18:16 +00:00
gen_aoti_c_shim.py [AOTI] Add more fallback ops (#126720) 2024-05-24 19:10:33 +00:00
gen_backend_stubs.py [TorchGen] [2/N] Remove unused variables and simplify dictionary iterations (#122585) 2024-03-29 20:34:11 +00:00
gen_executorch.py [BE]: TRY002 - Ban raising vanilla exceptions (#124570) 2024-04-21 22:26:40 +00:00
gen_functionalization_type.py Keep track of ViewMeta with symbolic inputs. (#125876) 2024-05-12 01:41:06 +00:00
gen_lazy_tensor.py [BE]: TRY002 - Ban raising vanilla exceptions (#124570) 2024-04-21 22:26:40 +00:00
gen_vmap_plumbing.py [TorchGen] [2/N] Remove unused variables and simplify dictionary iterations (#122585) 2024-03-29 20:34:11 +00:00
gen.py Fix multiple errors while parsing NativeFunctions from YAML (#127413) 2024-05-30 16:25:04 +00:00
local.py
model.py Fix multiple errors while parsing NativeFunctions from YAML (#127413) 2024-05-30 16:25:04 +00:00
native_function_generation.py [effects] Add inductor support for tokens (#122347) 2024-04-09 03:22:32 +00:00
utils.py [1/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort stdlib (#127122) 2024-05-25 08:25:50 +00:00
yaml_utils.py [Reland] Update mypy to 1.4.1 (#105227) 2023-07-15 20:30:20 +00:00