/
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/input_buffer.h
(1597B)
#pragma once // The InputBuffer class accumulates a list of Variables for use by a // function. It implements logic to avoid modifying the passed // values in-place (adding an input twice will accumulate the result). // This behaviour is needed and used only in backward graphs. #include <vector> #include <utility> #include <memory> #include <ATen/ATen.h> #include <torch/csrc/autograd/variable.h> #include <c10/util/Optional.h> #include <c10/core/Stream.h> namespace torch { namespace autograd { struct InputBuffer { // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) explicit InputBuffer(size_t size) : buffer(size) {} InputBuffer(const InputBuffer& other) = delete; InputBuffer(InputBuffer&& other) = default; // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) explicit InputBuffer(variable_list&& inputs): buffer(std::move(inputs)) {}; InputBuffer& operator=(InputBuffer&& other) = default; // Accumulates the variable at a specified index. // The optional CUDA streams determine which stream the accumulation // is run on and how the addition is synchronized. void add(size_t pos, Variable&& var, const c10::optional<c10::Stream>& opt_producer_stream, const c10::optional<c10::Stream>& opt_consumer_stream); at::Device device() const; Variable operator[](size_t pos) { return buffer[pos]; } // Returns the inputs as a list of variables. Destroys given InputBuffer. static std::vector<Variable> variables(InputBuffer&& g); private: std::vector<Variable> buffer; }; }} // namespace torch::autograd
Save
cmd:
run