xref: /aosp_15_r20/external/pytorch/tools/autograd/templates/python_enum_tag.cpp (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #include <torch/csrc/autograd/python_enum_tag.h>
2 #include <torch/csrc/utils/pybind.h>
3 #include <pybind11/pybind11.h>
4 #include <ATen/core/enum_tag.h>
5 
6 namespace py = pybind11;
7 namespace torch {
8     namespace autograd {
initEnumTag(PyObject * module)9     void initEnumTag(PyObject* module) {
10         auto m = py::handle(module).cast<py::module>();
11         py::enum_<at::Tag>(m, "Tag")
12         ${enum_of_valid_tags};
13         m.doc() = "An Enum that contains tags that can be assigned to an operator registered in C++.";
14     }
15 }}
16