pytorch/torch/csrc/utils
Pearu Peterson b3e4f5029b Add check-sparse-tensor-invariants flag to Context - 2nd try. (#92094)
This PR is a copy of https://github.com/pytorch/pytorch/pull/90849 that merge was reverted.

The PR adds "check sparse tensor invariants" flag to Context that when enabled will trigger sparse tensor data invariants checks in unsafe methods of constructing sparse COO/CSR/CSC/BSR/BSC tensors. The feature includes the following changes to UI:

`torch.sparse.check_sparse_tensor_invariants` class provides different ways to enable/disable the invariant checking.

`torch.sparse_coo/csr/csc/bsr/bsc/compressed_tensor` functions have a new optional argument `check_invariants` to enable/disable the invariant checks explicitly. When the `check_invariants` argument is specified, the global state of the feature is temporarily overridden.

The PR fixes https://github.com/pytorch/pytorch/issues/90833

Pull Request resolved: https://github.com/pytorch/pytorch/pull/92094
Approved by: https://github.com/cpuhrsch
2023-01-13 14:50:33 +00:00
..
auto_gil.h
byte_order.cpp
byte_order.h
cpp_stacktraces.cpp
cpp_stacktraces.h
cuda_enabled.h
cuda_lazy_init.cpp
cuda_lazy_init.h
disable_torch_function.cpp [Reland] add DisableTorchFunction that matches DisableTorchDispatch (#88219) (#92012) 2023-01-12 01:27:47 +00:00
disable_torch_function.h [Reland] add DisableTorchFunction that matches DisableTorchDispatch (#88219) (#92012) 2023-01-12 01:27:47 +00:00
init.cpp
init.h
invalid_arguments.cpp Fix a PyObject leak (#87608) 2022-10-24 23:55:13 +00:00
invalid_arguments.h
memory.h
nested.cpp Implement a constructor for nested_tensor that is similar to torch.tensor() (#88213) 2022-11-08 00:03:18 +00:00
nested.h Implement a constructor for nested_tensor that is similar to torch.tensor() (#88213) 2022-11-08 00:03:18 +00:00
numpy_stub.h
object_ptr.cpp
object_ptr.h
out_types.cpp
out_types.h
pybind.cpp Add unbacked symints support; item works now (#90624) 2022-12-12 13:33:07 +00:00
pybind.h Add unbacked symints support; item works now (#90624) 2022-12-12 13:33:07 +00:00
pycfunction_helpers.h
python_arg_parser.cpp [modes] make python arg parser also check for python key (#91573) 2023-01-11 15:19:43 +00:00
python_arg_parser.h [BC-Breaking] Separate stream_id, device_index, and device_type in pack and unpack for Streams (#81596) 2023-01-12 14:16:49 +00:00
python_compat.h Fix all simple compilation issues in eval_frame.c (#91166) 2022-12-21 19:39:04 +00:00
python_dispatch.cpp add autocast keys to pybind11 DispatchKey object (#90821) 2022-12-15 00:15:07 +00:00
python_dispatch.h Make Python op registration work with torchdeploy/multipy (#87162) 2022-11-03 12:56:44 +00:00
python_numbers.h
python_scalars.h
python_strings.h
python_stub.h
python_symnode.cpp Unify SymIntNode and SymFloatNode into SymNode (#87817) 2022-10-27 20:56:02 +00:00
python_symnode.h Use standard __func__ macro in symbolic shape. (#89264) 2022-11-18 17:03:53 +00:00
python_torch_function_mode.h [Modes] refactor modes to only use a stack in cpp (#86458) 2022-10-21 19:18:23 +00:00
python_tuples.h
pythoncapi_compat.h Use python compat from python/pythoncapi_compat (#91163) 2022-12-21 19:39:04 +00:00
schema_info.cpp
schema_info.h
six.h
structseq.cpp
structseq.h
tensor_apply.cpp Revert "Deduplicate c10 error and PyTorchError hierarchy (#87855)" 2023-01-06 19:56:35 +00:00
tensor_apply.h
tensor_dtypes.cpp Revert "Add bits tensor types (#88594)" 2022-11-30 11:37:56 +00:00
tensor_dtypes.h
tensor_flatten.cpp
tensor_flatten.h
tensor_layouts.cpp
tensor_layouts.h
tensor_list.cpp
tensor_list.h
tensor_memoryformats.cpp
tensor_memoryformats.h Add tests for custom pybind type_casters (#89897) 2022-12-02 07:02:09 +00:00
tensor_new.cpp Add check-sparse-tensor-invariants flag to Context - 2nd try. (#92094) 2023-01-13 14:50:33 +00:00
tensor_new.h
tensor_numpy.cpp Revert "Deduplicate c10 error and PyTorchError hierarchy (#87855)" 2023-01-06 19:56:35 +00:00
tensor_numpy.h Workaround for NumPy builds that ship with a broken Dlpack deleter (#89759) 2022-12-28 13:23:29 +00:00
tensor_qschemes.cpp
tensor_qschemes.h
tensor_types.cpp Revert "Deduplicate c10 error and PyTorchError hierarchy (#87855)" 2023-01-06 19:56:35 +00:00
tensor_types.h
throughput_benchmark-inl.h
throughput_benchmark.cpp
throughput_benchmark.h
torch_dispatch_mode.h Revert "[Modes] Add assert that the mode isn't already on the stack (#90770)" 2023-01-12 16:44:29 +00:00
variadic.cpp
variadic.h
verbose.cpp