Program Listing for File custom_operator.h¶
↰ Return to documentation for file (torch/csrc/jit/runtime/custom_operator.h
)
#pragma once
#include <ATen/core/op_registration/op_registration.h>
#include <ATen/core/stack.h>
#include <torch/csrc/jit/runtime/operator.h>
namespace torch::jit {
struct TORCH_API RegisterOperators {
RegisterOperators() = default;
explicit RegisterOperators(std::vector<c10::optional<Operator>> operators) {
for (c10::optional<Operator>& o : operators) {
if (o) {
registerOperator(std::move(o.value()));
}
}
}
};
} // namespace torch::jit