Files
pytorch/test/custom_backend/custom_backend.cpp
Martin Yuan 3551bd31be [PyTorch] Lite interpreter with a backend delegate (#54462)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/54462

Unclean files during sync - Sat Mar 20 04:00:02 PDT 2021

Unclean files during sync - Sun Mar 21 04:00:01 PDT 2021
ghstack-source-id: 124585992

Test Plan:
```
buck run xplat/caffe2/fb/test/delegate:interpreter_test -- --model_file_path=/path/to/mobile_model.ptl
```

Reviewed By: raziel

Differential Revision: D27232309

fbshipit-source-id: 8504a3185339d73bfa6e924485c4745acf269cec
2021-04-06 00:55:26 -07:00

17 lines
423 B
C++

#include "custom_backend.h"
#include <torch/csrc/jit/backends/backend_preprocess.h>
namespace torch {
namespace custom_backend {
namespace {
constexpr auto kBackendName = "custom_backend";
static auto cls = torch::jit::backend<CustomBackend>(kBackendName);
static auto pre_reg = torch::jit::backend_preprocess_register(kBackendName, preprocess);
}
std::string getBackendName() {
return std::string(kBackendName);
}
}
}