mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/40842 **Summary** This commit adds out-of-source-tree tests for `to_backend`. These tests check that a Module can be lowered to a backend, exported, loaded (in both Python and C++) and executed. **Fixes** This commit fixes #40067. Test Plan: Imported from OSS Differential Revision: D22418731 Pulled By: SplitInfinity fbshipit-source-id: 621ba4efc1b121fa76c9c7ca377792ac7440d250
15 lines
278 B
C++
15 lines
278 B
C++
#include "custom_backend.h"
|
|
|
|
namespace torch {
|
|
namespace custom_backend {
|
|
namespace {
|
|
constexpr auto kBackendName = "custom_backend";
|
|
static auto cls = torch::jit::backend<CustomBackend>(kBackendName);
|
|
}
|
|
|
|
std::string getBackendName() {
|
|
return std::string(kBackendName);
|
|
}
|
|
}
|
|
}
|