/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
torch
/
csrc
/
utils
/
/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/utils
mkdir
upload
Name
Size
Mode
Actions
auto_gil.h
1034
0644
edit
dl
rm
byte_order.h
2484
0644
edit
dl
rm
crash_handler.h
1146
0644
edit
dl
rm
cuda_enabled.h
154
0644
edit
dl
rm
cuda_lazy_init.h
974
0644
edit
dl
rm
disable_torch_function.h
863
0644
edit
dl
rm
disallow_copy.h
103
0644
edit
dl
rm
init.h
324
0644
edit
dl
rm
invalid_arguments.h
302
0644
edit
dl
rm
memory.h
1173
0644
edit
dl
rm
numpy_stub.h
399
0644
edit
dl
rm
object_ptr.h
1329
0644
edit
dl
rm
out_types.h
294
0644
edit
dl
rm
pybind.h
7966
0644
edit
dl
rm
pycfunction_helpers.h
209
0644
edit
dl
rm
python_arg_parser.h
30753
0644
edit
dl
rm
python_compat.h
2904
0644
edit
dl
rm
python_dispatch.h
174
0644
edit
dl
rm
python_numbers.h
5064
0644
edit
dl
rm
python_scalars.h
2928
0644
edit
dl
rm
python_strings.h
4592
0644
edit
dl
rm
python_stub.h
56
0644
edit
dl
rm
python_tuples.h
684
0644
edit
dl
rm
six.h
1425
0644
edit
dl
rm
structseq.h
153
0644
edit
dl
rm
tensor_apply.h
431
0644
edit
dl
rm
tensor_dtypes.h
244
0644
edit
dl
rm
tensor_flatten.h
2780
0644
edit
dl
rm
tensor_layouts.h
107
0644
edit
dl
rm
tensor_list.h
196
0644
edit
dl
rm
tensor_memoryformats.h
113
0644
edit
dl
rm
tensor_new.h
1807
0644
edit
dl
rm
tensor_numpy.h
542
0644
edit
dl
rm
tensor_qschemes.h
186
0644
edit
dl
rm
tensor_types.h
491
0644
edit
dl
rm
throughput_benchmark-inl.h
5210
0644
edit
dl
rm
throughput_benchmark.h
6868
0644
edit
dl
rm
variadic.h
4394
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/utils/auto_gil.h
(1034B)
#pragma once // RAII structs to acquire and release Python's global interpreter lock (GIL) #include <c10/util/Deprecated.h> #include <torch/csrc/python_headers.h> // TODO: Deprecate these structs after we land this diff // (to avoid -Werror failures) // Acquires the GIL on construction struct /* C10_DEPRECATED_MESSAGE( "Use pybind11::gil_scoped_acquire instead") */ AutoGIL { AutoGIL() : gstate(PyGILState_Ensure()) {} ~AutoGIL() { PyGILState_Release(gstate); } PyGILState_STATE gstate; }; // Releases the GIL on construction struct /* C10_DEPRECATED_MESSAGE( "Use pybind11::gil_scoped_release instead") */ AutoNoGIL { AutoNoGIL() : save(PyEval_SaveThread()) {} ~AutoNoGIL() { PyEval_RestoreThread(save); } PyThreadState* save; }; // Runs the function without the GIL template <typename F> /* C10_DEPRECATED */ inline void with_no_gil(F f) { // TODO: The deprecation here triggers a deprecated use warning // on some versions of compilers; need to avoid this AutoNoGIL no_gil; f(); }
Save
cmd:
run