pytorch/torch/csrc/utils
Tobias Ringwald 76f3663efe Fixed a memory leak when calling from_numpy on a numpy array with an … (#121156)
…unsupported dtype.

Fixes #121138.

The lambda function that DECREFs the object is not called when the dtype conversion functions throws. This PR moves the conversion before the INCREF, which prevents the memory leak.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/121156
Approved by: https://github.com/soulitzer, https://github.com/albanD
2024-03-06 19:37:38 +00:00
..
byte_order.cpp [CI] Update clang-format (#116002) 2023-12-18 14:58:46 +00:00
byte_order.h
cpp_stacktraces.cpp
cpp_stacktraces.h
cuda_enabled.h
device_lazy_init.cpp [RELAND] refactor lazy init to device-agnostic (#119248) 2024-02-07 15:58:51 +00:00
device_lazy_init.h [4/4] Intel GPU Runtime Upstreaming for Device (#116869) 2024-02-08 03:01:21 +00:00
disable_torch_function.cpp Revert "[Exception] [6/N] Remove use of torch::TypeError (#117964)" 2024-01-27 08:44:34 +00:00
disable_torch_function.h Support Predispatch functionalization (#113728) 2023-12-19 20:28:35 +00:00
init.cpp
init.h
invalid_arguments.cpp
invalid_arguments.h
nested.cpp
nested.h
numpy_stub.h
object_ptr.cpp
object_ptr.h
out_types.cpp
out_types.h
pybind.cpp Make c10::SymInt typecaster support scalar-like fake tensor (#117454) 2024-01-14 15:15:29 +00:00
pybind.h [Clang-tidy header][17/N] Apply clang-tidy on headers in torch/csrc/cuda (#117829) 2024-01-26 13:33:24 +00:00
pycfunction_helpers.h
pyobject_preservation.cpp
pyobject_preservation.h
python_arg_parser.cpp Revert "[Exception] [6/N] Remove use of torch::TypeError (#117964)" 2024-01-27 08:44:34 +00:00
python_arg_parser.h Revert "Increased compile time max GPUs to 512. Switched to int16_t DeviceIndex. (#119639)" 2024-02-28 18:57:09 +00:00
python_compat.h
python_dispatch.cpp Better error messages for impl_abstract_pystub (#120959) 2024-03-04 15:24:36 +00:00
python_dispatch.h
python_numbers.h [DeviceIndex][3/N] Use DeviceIndex in more places (#119635) 2024-02-12 21:31:27 +00:00
python_raii.h
python_scalars.h Avoid COW materialize in various operations (#119506) 2024-02-09 14:47:19 +00:00
python_strings.h
python_stub.h
python_symnode.cpp
python_symnode.h Add is_nested_int() (#119975) 2024-02-21 21:10:02 +00:00
python_torch_function_mode.h
python_tuples.h
pythoncapi_compat.h
schema_info.cpp
schema_info.h
six.h
structseq.cpp
structseq.h
tensor_apply.cpp [Exception] [3/N] Replace torch::NotImplementedError and torch::LinAlgError with C10 counterparts. (#116824) 2024-01-11 11:27:04 +00:00
tensor_apply.h
tensor_dtypes.cpp Add uint1 to uint7 dtypes (#117208) 2024-01-13 01:09:23 +00:00
tensor_dtypes.h
tensor_flatten.cpp
tensor_flatten.h
tensor_layouts.cpp
tensor_layouts.h
tensor_list.cpp Avoid COW materialize in various operations (#119506) 2024-02-09 14:47:19 +00:00
tensor_list.h
tensor_memoryformats.cpp
tensor_memoryformats.h [12/N] Apply clang-tidy and fix warnings in headers of torch/csrc (#116486) 2024-01-10 08:48:14 +00:00
tensor_new.cpp Add SparsePrivateUse1 in backend_to_string, layout_from_backend and check_base_legacy_new. (#119263) 2024-02-26 01:54:30 +00:00
tensor_new.h
tensor_numpy.cpp Fixed a memory leak when calling from_numpy on a numpy array with an … (#121156) 2024-03-06 19:37:38 +00:00
tensor_numpy.h [12/N] Apply clang-tidy and fix warnings in headers of torch/csrc (#116486) 2024-01-10 08:48:14 +00:00
tensor_qschemes.cpp
tensor_qschemes.h
tensor_types.cpp Add SparsePrivateUse1 in backend_to_string, layout_from_backend and check_base_legacy_new. (#119263) 2024-02-26 01:54:30 +00:00
tensor_types.h Add SparsePrivateUse1 in backend_to_string, layout_from_backend and check_base_legacy_new. (#119263) 2024-02-26 01:54:30 +00:00
throughput_benchmark-inl.h init tls grad_mode/local_dispatch_key set while fork new thread in (#113246) 2024-01-11 08:31:46 +00:00
throughput_benchmark.cpp
throughput_benchmark.h
torch_dispatch_mode.h
variadic.cpp
variadic.h [12/N] Apply clang-tidy and fix warnings in headers of torch/csrc (#116486) 2024-01-10 08:48:14 +00:00
verbose.cpp
verbose.h