/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
torch
/
csrc
/
autograd
/
/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/autograd
mkdir
upload
Name
Size
Mode
Actions
functions/
-
0755
rm
generated/
-
0755
rm
utils/
-
0755
rm
anomaly_mode.h
1525
0644
edit
dl
rm
autograd.h
5294
0644
edit
dl
rm
autograd_not_implemented_fallback.h
201
0644
edit
dl
rm
cpp_hook.h
518
0644
edit
dl
rm
custom_function.h
14470
0644
edit
dl
rm
edge.h
1627
0644
edit
dl
rm
engine.h
17237
0644
edit
dl
rm
forward_grad.h
8583
0644
edit
dl
rm
function.h
25046
0644
edit
dl
rm
FunctionsManual.h
19904
0644
edit
dl
rm
function_hook.h
641
0644
edit
dl
rm
grad_mode.h
207
0644
edit
dl
rm
InferenceMode.h
182
0644
edit
dl
rm
input_buffer.h
1597
0644
edit
dl
rm
input_metadata.h
1384
0644
edit
dl
rm
profiler.h
112
0644
edit
dl
rm
profiler_kineto.h
9111
0644
edit
dl
rm
profiler_legacy.h
16930
0644
edit
dl
rm
profiler_utils.h
439
0644
edit
dl
rm
python_anomaly_mode.h
1246
0644
edit
dl
rm
python_autograd.h
388
0644
edit
dl
rm
python_cpp_function.h
2456
0644
edit
dl
rm
python_engine.h
1262
0644
edit
dl
rm
python_fft_functions.h
128
0644
edit
dl
rm
python_function.h
4099
0644
edit
dl
rm
python_hook.h
700
0644
edit
dl
rm
python_legacy_variable.h
299
0644
edit
dl
rm
python_linalg_functions.h
131
0644
edit
dl
rm
python_mode.h
425
0644
edit
dl
rm
python_nn_functions.h
127
0644
edit
dl
rm
python_saved_variable_hooks.h
883
0644
edit
dl
rm
python_special_functions.h
132
0644
edit
dl
rm
python_torch_functions.h
671
0644
edit
dl
rm
python_variable.h
1645
0644
edit
dl
rm
python_variable_indexing.h
313
0644
edit
dl
rm
record_function_ops.h
587
0644
edit
dl
rm
saved_variable.h
4322
0644
edit
dl
rm
saved_variable_hooks.h
272
0644
edit
dl
rm
symbolic.h
330
0644
edit
dl
rm
variable.h
33411
0644
edit
dl
rm
VariableTypeUtils.h
15086
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/autograd/anomaly_mode.h
(1525B)
#pragma once #include <string> #include <memory> #include <torch/csrc/WindowsTorchApiMacro.h> namespace torch { namespace autograd { // forward declaration of Node from function.h struct Node; struct TORCH_API AnomalyMode { static bool is_enabled() { return _enabled; } static void set_enabled(bool enabled) { _enabled = enabled; } private: static bool _enabled; }; /// A RAII guard that enables Anomaly Detection Mode. /// /// Anomaly detection mode is useful for debugging problems happening /// in the backward, such as unexpectedly modified tensors or NaNs /// occuring in the backward. /// /// The enabling of anomaly mode is global - as soon as there is one /// such guard, it is enabled for all computation and threads. It also /// comes with a significant performance penalty. /// /// Example: /// @code /// auto x = torch::tensor({1.}, torch::requires_grad()); /// { /// torch::autograd::DetectAnomalyGuard detect_anomaly; /// auto x = torch::tensor({5.0}, torch::requires_grad()); /// auto y = x * x; /// auto z = y * y; /// y += 1; /// z.backward(); /// } /// @endcode class TORCH_API DetectAnomalyGuard { public: DetectAnomalyGuard(); ~DetectAnomalyGuard(); }; struct TORCH_API AnomalyMetadata { virtual ~AnomalyMetadata(); virtual void store_stack(); virtual void print_stack(const std::string& current_node_name); virtual void assign_parent(const std::shared_ptr<Node>& parent_node); private: std::string traceback_; std::shared_ptr<Node> parent_; }; }}
Save
cmd:
run