Caffe2 - C++ API
A deep learning, cross platform ML framework
class_type.cpp
1 #include <ATen/core/jit_type.h>
2 #include <torch/csrc/jit/script/module.h>
3 
4 namespace c10 {
5 
6 // This file exists because we need to reference module.h, which we can't from
7 // c10. Sigh...
8 Method* ClassType::getMethod(const std::string& name) const {
9  return module_->find_method(name);
10 }
11 
12 std::vector<Method*> ClassType::methods() const {
13  const auto& methods = module_->get_methods();
14  std::vector<Method*> ret;
15  for (const auto& pr : methods.items()) {
16  ret.push_back(pr.value().get());
17  }
18  return ret;
19 }
20 } // namespace c10
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...
Definition: alias_info.h:7