本文整理汇总了C++中py::module::name方法的典型用法代码示例。如果您正苦于以下问题:C++ module::name方法的具体用法?C++ module::name怎么用?C++ module::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py::module
的用法示例。
在下文中一共展示了module::name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: define_module
void define_module(py::module &m) {
auto module_class = py::class_<Module>(m, "Module")
.def(py::init<const std::string &, const Target &>(), py::arg("name"), py::arg("target"))
.def("target", &Module::target)
.def("name", &Module::name)
.def("auto_schedule", &Module::auto_schedule)
.def("buffers", &Module::buffers)
.def("submodules", &Module::submodules)
.def("append", (void (Module::*)(const Buffer<> &)) &Module::append, py::arg("buffer"))
.def("append", (void (Module::*)(const Module &)) &Module::append, py::arg("module"))
.def("compile", &Module::compile, py::arg("outputs"))
.def("compile_to_buffer", &Module::compile_to_buffer)
.def("resolve_submodules", &Module::resolve_submodules)
.def("remap_metadata_name", &Module::remap_metadata_name)
.def("get_metadata_name_map", &Module::get_metadata_name_map)
.def("set_auto_schedule", &Module::set_auto_schedule)
// TODO: ExternalCode-related methods deliberately skipped for now.
// .def("append", (void (Module::*)(const ExternalCode &)) &Module::append, py::arg("external_code"))
// .def("external_code", &Module::external_code)
// TODO: Internal::LoweredFunc-related methods deliberately skipped for now.
// .def("functions", &Module::functions)
// .def("get_function_by_name", &Module::get_function_by_name, py::arg("name"))
// .def("append", (void (Module::*)(const Internal::LoweredFunc &)) &Module::append, py::arg("function"))
.def("__repr__", [](const Module &m) -> std::string {
std::ostringstream o;
o << "<halide.Module '" << m.name() << "'>";
return o.str();
})
;
m.def("link_modules", &link_modules, py::arg("name"), py::arg("modules"));
m.def("compile_standalone_runtime", (void (*)(const std::string &, Target)) &compile_standalone_runtime, py::arg("filename"), py::arg("target"));
m.def("compile_standalone_runtime", (Outputs (*)(const Outputs &, Target)) &compile_standalone_runtime, py::arg("outputs"), py::arg("target"));
// TODO: compile_multitarget() deliberately skipped for now.
}