pytorch/test
Yanan Cao c22bbb2124 [JIT] Add Type::repr_str to return human-readable str (#39544)
Summary:
Clearly expressing a type is inferred by PyTorch instead of explicitly annotated by user makes many error messages more user-friendly

Currently Type has two string conversion methods. str() for IR printing and python_str() for serialization and error message generation. If we want to include more information in type printing while maintaining serialization/deserialization correctness, we need to split python_str() into annotation_str() and repr_str().

annotation_str is solely responsible for serialization, it strictly matches format of python type annotation. repr_str() is responsible for generating a human-readable error message that includes information like "this type is inferred, not explicitly annotated"

Closes https://github.com/pytorch/pytorch/issues/39449
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39544

Differential Revision: D21978759

Pulled By: gmagogsfm

fbshipit-source-id: 733566f5a62e748b5ca4bb3c5943ebb6d5b664d0
2020-06-10 12:01:24 -07:00
..
backward_compatibility add overload name for min/max with list input (#39614) 2020-06-08 06:13:10 -07:00
bottleneck_test fix possible pandas import error during tensorboard tests (#29650) 2020-02-04 14:27:46 -08:00
cpp [JIT] Add Type::repr_str to return human-readable str (#39544) 2020-06-10 12:01:24 -07:00
cpp_api_parity Updates assertEqual to require atol and rtol, removes positional atol (#38872) 2020-05-27 06:31:07 -07:00
cpp_extensions Remove datatype from Storage and StorageImpl (#38870) 2020-05-21 15:26:08 -07:00
custom_operator Support c10::optional<Tensor> in custom C++ autograd function. (#37700) 2020-05-06 01:59:51 -07:00
distributed [PyTorch] Make DDP reducer work under distributed autograd (#37998) 2020-06-10 08:38:14 -07:00
error_messages
expect Clean up error handling in is_nonzero and where in TensorCompare.cpp (#38150) 2020-05-13 20:19:40 -07:00
jit Preserve user specified attributes and methods (#38830) 2020-06-10 01:38:18 -07:00
mobile Enabling lite interpreter in torch python API (#39181) 2020-06-03 18:33:23 -07:00
onnx Fix ONNX export of RNNs with no bias (#36894) 2020-06-08 20:36:22 -07:00
optim
quantization [quant][graphmode] Support quantization for aten::append (#39644) 2020-06-10 11:29:27 -07:00
scripts
type_hint_tests Fix multiple issues with type annotations (#36358) 2020-04-29 11:16:39 -07:00
HowToWriteTestsUsingFileCheck.md
print_test_stats.py Upgrade lint. (#39483) 2020-06-04 12:56:43 -07:00
run_test.py [PyTorch] Make DDP reducer work under distributed autograd (#37998) 2020-06-10 08:38:14 -07:00
simulate_nccl_errors.py
te_utils.py add test_tensorexpr.py (#35776) 2020-04-01 22:05:37 -07:00
test_autograd.py Add torch.flip{lr, ud} (#38599) 2020-06-09 07:19:37 -07:00
test_bundled_inputs.py Add utility for bundling sample inputs with models (#35631) 2020-04-08 13:10:36 -07:00
test_complex.py Remove copy_imag and copy_real methods (#39065) 2020-06-03 18:22:50 -07:00
test_cpp_api_parity.py Refactor C++ API parity test mechanism and turn it on in CI again (#35190) 2020-04-03 11:20:36 -07:00
test_cpp_extensions_aot.py Updates assertEqual to require atol and rtol, removes positional atol (#38872) 2020-05-27 06:31:07 -07:00
test_cpp_extensions_jit.py Updates assertEqual to require atol and rtol, removes positional atol (#38872) 2020-05-27 06:31:07 -07:00
test_cuda_primary_ctx.py Move pytorch distributed tests to separate folder for contbuild. (#30445) 2020-01-22 21:16:59 -08:00
test_cuda.py [ROCm] Enable AMP autocast tests on ROCm (#39616) 2020-06-08 10:30:39 -07:00
test_dataloader.py The exception raised when RandomSampler.replacement is non-boolean should be TypeError (#36547) 2020-06-02 06:54:02 -07:00
test_determination.py Use @skipIfNoFBGEMM instead of direct check (#39068) 2020-06-01 17:15:36 -07:00
test_dispatch.py Switch to pybind11 style registration function API. (#36258) 2020-04-16 10:44:21 -07:00
test_distributions.py Updates assertEqual to require atol and rtol, removes positional atol (#38872) 2020-05-27 06:31:07 -07:00
test_expecttest.py Move pytorch distributed tests to separate folder for contbuild. (#30445) 2020-01-22 21:16:59 -08:00
test_function_schema.py Move pytorch distributed tests to separate folder for contbuild. (#30445) 2020-01-22 21:16:59 -08:00
test_futures.py Expose torch.futures.Future (#39008) 2020-06-02 10:12:56 -07:00
test_indexing.py Changes TensorIterator computation to not consider out kwarg, lets UnaryOps safe cast to out (#39655) 2020-06-10 09:04:13 -07:00
test_jit_cuda_fuser.py [nvFuser] add torch.jit.fuser context manager (#38993) 2020-06-01 10:52:40 -07:00
test_jit_disabled.py Move pytorch distributed tests to separate folder for contbuild. (#30445) 2020-01-22 21:16:59 -08:00
test_jit_fuser_legacy.py
test_jit_fuser_te.py [JIT] Exit Transform Rewrite (#38282) 2020-05-15 12:22:28 -07:00
test_jit_fuser.py [JIT] Exit Transform Rewrite (#38282) 2020-05-15 12:22:28 -07:00
test_jit_legacy.py Remove (most) Python 2 support from Python code (#35615) 2020-04-22 09:23:14 -07:00
test_jit_profiling.py run the simple executor for jit tests by default, add profiling jobs … (#37017) 2020-04-28 19:16:52 -07:00
test_jit_py3.py Upgrade lint. (#39483) 2020-06-04 12:56:43 -07:00
test_jit_simple.py make test_jit infer the profiling mode, add a job for simple executor (#38374) 2020-05-13 23:55:40 -07:00
test_jit_string.py [PyTorch][TorchScript] Add support for join on List of strings in TorchScript (#32847) 2020-01-31 18:20:38 -08:00
test_jit.py [JIT] Add Type::repr_str to return human-readable str (#39544) 2020-06-10 12:01:24 -07:00
test_logging.py Move pytorch distributed tests to separate folder for contbuild. (#30445) 2020-01-22 21:16:59 -08:00
test_mkldnn.py cover nn.Conv1d in mkldnn model conversion logic (#38528) 2020-05-19 13:04:18 -07:00
test_mobile_optimizer.py Propagate module lints for mobile scripted module. (#37046) 2020-04-27 10:20:12 -07:00
test_multiprocessing_spawn.py Remove (most) Python 2 support from Python code (#35615) 2020-04-22 09:23:14 -07:00
test_multiprocessing.py Updates assertEqual to require atol and rtol, removes positional atol (#38872) 2020-05-27 06:31:07 -07:00
test_namedtensor.py Remove supports_named_tensor from codegen entirely. (#38739) 2020-06-01 13:09:08 -07:00
test_namedtuple_return_api.py Added cummin 2020-01-17 10:51:58 -08:00
test_nn.py Nearest interpolation gpu implementation fix [Resolves issue #38985] (#39055) 2020-05-28 08:07:14 -07:00
test_numba_integration.py Remove (most) Python 2 support from Python code (#35615) 2020-04-22 09:23:14 -07:00
test_optim.py Make Optimizer.state_dict() nondeterministic (#37347) 2020-06-01 15:32:02 -07:00
test_overrides.py Fix incorrect __torch_function__ handling in einsum (#38741) 2020-05-21 06:59:25 -07:00
test_quantization.py Add JIT fusion pass to fuse quantized add and relu. (#38897) 2020-05-27 14:16:57 -07:00
test_serialization.py [JIT] Make new zip serialization for torch save/load significantly (~70%) faster (#38379) 2020-05-29 01:56:18 -07:00
test_show_pickle.py Add torch.utils.show_pickle for showing pickle contents in saved models (#35168) 2020-04-03 15:11:20 -07:00
test_sparse.py Updates assertEqual to require atol and rtol, removes positional atol (#38872) 2020-05-27 06:31:07 -07:00
test_tensorboard.py Upgrade lint. (#39483) 2020-06-04 12:56:43 -07:00
test_tensorexpr.py move num_profiled_runs to common_utils (#38687) 2020-05-27 01:14:01 -07:00
test_throughput_benchmark.py ThroughputBenchmark: integration with Autograd Profiler (#36282) 2020-04-13 08:53:40 -07:00
test_torch.py Changes TensorIterator computation to not consider out kwarg, lets UnaryOps safe cast to out (#39655) 2020-06-10 09:04:13 -07:00
test_type_hints.py Add --check-untyped-defs to mypy.ini and test suite (#37594) 2020-05-07 06:36:01 -07:00
test_type_info.py Move pytorch distributed tests to separate folder for contbuild. (#30445) 2020-01-22 21:16:59 -08:00
test_type_promotion.py Changes TensorIterator computation to not consider out kwarg, lets UnaryOps safe cast to out (#39655) 2020-06-10 09:04:13 -07:00
test_utils.py Retry/skip test on URLError rather than on HTTPError (#39477) 2020-06-03 17:29:40 -07:00
test_xnnpack_integration.py Add preprocessing that fuses decomposed linear into linear. (#37937) 2020-05-07 18:08:36 -07:00