3 #include <torch/csrc/WindowsTorchApiMacro.h> 4 #include <torch/csrc/autograd/function.h> 5 #include <torch/csrc/autograd/variable.h> 6 #include <torch/csrc/autograd/symbolic.h> 12 namespace torch {
namespace autograd {
14 struct TORCH_API
Error :
public Function {
15 Error(std::string msg, edge_list&& next_edges)
16 : Function(std::move(next_edges))
17 , msg(std::move(msg)) {}
19 Error(std::string msg)
20 : msg(std::move(msg)) {}
22 variable_list apply(variable_list&& inputs)
override;
31 NotImplemented(
const std::string& forward_fn, edge_list&& next_edges)
32 :
Error(
"derivative for " + forward_fn +
" is not implemented",
33 std::move(next_edges)) {}
35 NotImplemented(
const std::string& forward_fn)
36 :
Error(
"derivative for " + forward_fn +
" is not implemented") {}
42 : msg(std::move(msg)) {
43 for (
int i = 0; i < num_inputs; i++)
44 add_input_metadata(Function::undefined_input());
47 variable_list apply(variable_list&& inputs)
override;
53 GraphRoot(edge_list functions, variable_list inputs)
54 : Function(std::move(functions)),
55 outputs(std::move(inputs)) {}
57 variable_list apply(variable_list&& inputs)
override {
61 variable_list outputs;
The primary ATen error class.