mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Summary: att Test Plan: ci Rollback Plan: Differential Revision: D81731425 Pull Request resolved: https://github.com/pytorch/pytorch/pull/162353 Approved by: https://github.com/yiming0416
35 lines
890 B
C++
35 lines
890 B
C++
#pragma once
|
|
|
|
#include <torch/nativert/executor/DelegateExecutor.h>
|
|
#include <torch/nativert/executor/ExecutorConfig.h>
|
|
|
|
namespace torch::nativert {
|
|
|
|
class ETDelegateExecutor : public DelegateExecutor {
|
|
public:
|
|
explicit ETDelegateExecutor(
|
|
const std::string_view& dir_prefix,
|
|
const Node& node)
|
|
: delegate_dir_([&]() {
|
|
const std::string* path =
|
|
std::get_if<std::string>(&node.attributes()[0].value);
|
|
TORCH_CHECK(
|
|
path != nullptr,
|
|
"et hop's first attribute should correspond to it's path");
|
|
return std::string(dir_prefix) + *path;
|
|
}()) {
|
|
VLOG(1) << "ETDelegateExecutor: " << delegate_dir_;
|
|
}
|
|
|
|
~ETDelegateExecutor() override = default;
|
|
|
|
const std::string& get_delegate_dir() {
|
|
return delegate_dir_;
|
|
}
|
|
|
|
private:
|
|
std::string delegate_dir_;
|
|
};
|
|
|
|
} // namespace torch::nativert
|