Files
pytorch/torch/csrc/jit/python/python_custom_class.h
cyy 99f5a85a09 [Clang Tidy] Fix misc-header-include-cycle errors in clang-tidy and ignore some files (#127233)
Since there are such cycles in libfmt and PyTorch, which are detected by clang-tidy.
```
/home/cyy/pytorch/third_party/fmt/include/fmt/format-inl.h:25:10: error: circular header file dependency detected while including 'format.h', please check the include path [misc-header-include-cycle,-warnings-as-errors]
   25 | #include "format.h"
      |          ^
/home/cyy/pytorch/third_party/fmt/include/fmt/format.h:4530:12: note: 'format-inl.h' included from here
 4530 | #  include "format-inl.h"
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/127233
Approved by: https://github.com/ezyang
2024-06-10 23:49:58 +00:00

20 lines
398 B
C++

#pragma once
#include <torch/csrc/utils/pybind.h>
#include <torch/custom_class.h>
namespace torch::jit {
void initPythonCustomClassBindings(PyObject* module);
struct ScriptClass {
ScriptClass(c10::StrongTypePtr class_type)
: class_type_(std::move(class_type)) {}
py::object __call__(py::args args, py::kwargs kwargs);
c10::StrongTypePtr class_type_;
};
} // namespace torch::jit