Shortcuts

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

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources