pytorch/torch
Edward Z. Yang 8c4812be80 Replace expect_int with guard_int (#113921)
The idea is that instead of erroring, we will just specialize at these sites.

Fixes https://github.com/pytorch/pytorch/issues/113142

Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/113921
Approved by: https://github.com/zou3519
2023-11-20 21:27:48 +00:00
..
_awaits
_C Enable import following in MYPYNOFOLLOW (now MYPYINDUCTOR) (#113830) 2023-11-17 18:24:21 +00:00
_C_flatbuffer
_custom_op [BE]: Remove useless lambdas (#113602) 2023-11-14 20:06:48 +00:00
_decomp Revert "Add torch._lazy_clone to create COW tensors (#113397)" 2023-11-20 10:21:09 +00:00
_dispatch
_dynamo Insert deferred runtime asserts into Dynamo FX graph (#113958) 2023-11-20 21:25:11 +00:00
_export [export] Turn on verifier for serialization. (#113980) 2023-11-20 18:32:16 +00:00
_functorch [functorch] fix potential race condition while loading vmap decomposition library (#113520) 2023-11-20 19:50:54 +00:00
_higher_order_ops [Easy] Fix typo in TagActivationCheckpoint comment (#113818) 2023-11-16 06:06:09 +00:00
_inductor [AOTI] Improve the two-pass wrapper codegen (#114067) 2023-11-19 23:30:36 +00:00
_lazy
_library
_logging [dynamo] re-add option to log all guard check fails (#113585) 2023-11-16 21:20:29 +00:00
_numpy BUG: fix np.ndarray.resize under dynamo (#113931) 2023-11-17 18:12:17 +00:00
_prims Fix metafunction for many pointwise operations (#113634) 2023-11-16 19:09:12 +00:00
_prims_common Run sympy expressions with Python values / FX tracing (#113978) 2023-11-20 21:25:11 +00:00
_refs improve annotation device parameters where a device ordinal is allowed (#113647) 2023-11-17 14:41:22 +00:00
_subclasses Allow for calling lift_fresh_copy manually (#113923) 2023-11-19 07:13:49 +00:00
amp
ao [quant][pt2] Support conv1d-bn QAT fusion (#113714) 2023-11-17 22:09:30 +00:00
autograd Fix chrome trace entry format (#113763) 2023-11-15 17:07:40 +00:00
backends Resolve docstring errors in throughput_benchmark.py, weak.py, _traceback.py, file_baton.py, _contextlib.py, _device.py, cpp_backtrace.py, bundled_inputs.py, run_cpu.py, hooks.py, mobile_optimizer.py, _freeze.py, __init__.py, mkldnn.py, dlpack.py (#113311) 2023-11-15 17:40:04 +00:00
compiler
contrib Fixed docstring errors in _fuser.py, _state.py, __init__.py, _freeze.py, _async.py, _recursive.py, _tensorboard_vis.py, _trace.py, _await.py, _check.py, _serialization.py, _script.py, annotations.py, _monkeytype_config.py (#113371) 2023-11-12 03:19:02 +00:00
cpu
csrc Replace expect_int with guard_int (#113921) 2023-11-20 21:27:48 +00:00
cuda [BE]: ruff apply rule PLW1510 to find silent subprocess errors (#113644) 2023-11-14 20:59:40 +00:00
distributed [dtensor] support convolution ops (#113123) 2023-11-20 21:01:28 +00:00
distributions [doc] two diff meanings of rv generated by torch.tensor.geometric_ and torch.distributions.geometric.Geometric (#113183) 2023-11-15 03:49:04 +00:00
export [export][retry] Move lifted tensors out of state_dict (#113689) 2023-11-15 09:24:49 +00:00
fft
func
futures
fx Insert deferred runtime asserts into Dynamo FX graph (#113958) 2023-11-20 21:25:11 +00:00
jit make_fx can now SymIntify int inputs (#113452) 2023-11-18 06:39:09 +00:00
legacy
lib
linalg
masked make_fx can now SymIntify int inputs (#113452) 2023-11-18 06:39:09 +00:00
monitor
mps
multiprocessing Add sparse tensors support to dataloader. (#112842) 2023-11-19 16:05:27 +00:00
nested Fix to wrap jagged dims for split() / split_with_sizes() (#113591) 2023-11-14 19:36:08 +00:00
nn Update sdpa doctstring to point to flash-attn-v2 (#114124) 2023-11-20 19:05:30 +00:00
onnx [ONNX] Relax unsupported node analysis on complex dtype (#113785) 2023-11-17 20:11:20 +00:00
optim fixed pyi file for ReduceLROnPlateau (#113659) 2023-11-15 19:33:36 +00:00
package
profiler
quantization
signal
sparse Eliminate unnecessary multiplications by 1 in addmm with sparse compressed tensor operand (#114026) 2023-11-19 12:13:54 +00:00
special
testing add Half support for AdaptiveAvgPool2d and AdaptiveMaxPool2d on CPU (#102079) 2023-11-20 03:01:00 +00:00
utils Run sympy expressions with Python values / FX tracing (#113978) 2023-11-20 21:25:11 +00:00
__config__.py
__future__.py
__init__.py Run sympy expressions with Python values / FX tracing (#113978) 2023-11-20 21:25:11 +00:00
_appdirs.py
_classes.py
_compile.py
_custom_ops.py
_deploy.py
_guards.py Make {Tracing,Compile}Context.get() return non-optional type (#113535) 2023-11-14 04:31:12 +00:00
_jit_internal.py
_linalg_utils.py
_lobpcg.py
_lowrank.py
_meta_registrations.py [BE][easy] Simplify the registration of a few metafunctions (#113635) 2023-11-16 19:09:12 +00:00
_namedtensor_internals.py
_ops.py
_python_dispatcher.py
_sources.py
_storage_docs.py
_streambase.py
_tensor.py Drop dynamo-specific type hints on Tensor in favor of type-ignores (#113720) 2023-11-16 01:54:00 +00:00
_tensor_docs.py [doc] two diff meanings of rv generated by torch.tensor.geometric_ and torch.distributions.geometric.Geometric (#113183) 2023-11-15 03:49:04 +00:00
_tensor_str.py Do not error when printing view created in no-grad modified in-place in no-grad (#113716) 2023-11-16 18:57:56 +00:00
_torch_docs.py [doc] caution torch.multinomial usage (#112892) 2023-11-15 18:20:48 +00:00
_utils.py
_utils_internal.py
_VF.py
_vmap_internals.py
_weights_only_unpickler.py [BE] Do not warn when safely loading legacy dicts (#113614) 2023-11-14 22:09:10 +00:00
abi-check.cpp
CMakeLists.txt Revert "[BE] [cuDNN] Always build assuming cuDNN >= 8.0 (#95722)" 2023-11-10 17:26:36 +00:00
custom_class.h Revert "[1/N] Fixes clang-tidy warnings in header files (#113608)" 2023-11-16 22:38:41 +00:00
custom_class_detail.h
extension.h
functional.py make_fx can now SymIntify int inputs (#113452) 2023-11-18 06:39:09 +00:00
hub.py
library.h [fbgemm_gpu] add pt2_compliant tag to some ops (#113201) 2023-11-10 00:32:30 +00:00
library.py
overrides.py Run sympy expressions with Python values / FX tracing (#113978) 2023-11-20 21:25:11 +00:00
py.typed
quasirandom.py
random.py
README.txt
return_types.py
script.h
serialization.py [BE] Do not warn when safely loading legacy dicts (#113614) 2023-11-14 22:09:10 +00:00
storage.py Fix pydocstyle errors listed in issue 112589 (#113227) 2023-11-13 22:05:45 +00:00
torch_version.py
types.py improve annotation device parameters where a device ordinal is allowed (#113647) 2023-11-17 14:41:22 +00:00
version.py.tpl

Note [TH abstraction violation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TH/THC provide some hpp headers, which are proper C++ headers rather than
C headers.  These headers serve double duty as *internal implementation
detail* headers, whose contents should largely not be used by external
clients.

Ideally, we would not install these headers at all; instead, you should
use public functions (in headers like `THTensor.h`, NOT `THTensor.hpp`)
to manipulate these structs.  However, there are a few places
in torch/csrc where we violate this abstraction.  They are marked with
a pointer to this note.  Each of those sites will have to be refactored
when we refactor the guts of THTensor and related structures.