Files
pytorch/torch/nativert/executor/SerialGraphExecutor.h
Yiming Zhou e98dd95446 [nativert] Move SerialGraphExecutor to PyTorch core (#156459)
Summary: `SerialGraphExecutor` inherits from `GraphExecutorBase` and executes all nodes in the graph in a serial manner

Test Plan:
CI

Rollback Plan:

Differential Revision: D76917966

Pull Request resolved: https://github.com/pytorch/pytorch/pull/156459
Approved by: https://github.com/zhxchen17, https://github.com/jingsh
2025-06-21 01:32:06 +00:00

24 lines
634 B
C++

#pragma once
#include <torch/nativert/executor/GraphExecutorBase.h>
namespace torch::nativert {
class SerialGraphExecutor : public GraphExecutorBase {
public:
SerialGraphExecutor(
const Graph& graph,
std::vector<std::unique_ptr<OpKernel>> nodeKernels,
const ExecutorConfig& executorConfig)
: GraphExecutorBase(graph, std::move(nodeKernels), executorConfig) {}
std::vector<c10::IValue> execute(
ExecutionFrame& frame,
std::vector<c10::IValue> inputs) override;
std::vector<c10::IValue> executeWithPrefilledFrame(
ExecutionFrame& frame) override;
};
} // namespace torch::nativert