1#pragma once
2
3#include <torch/csrc/jit/ir/ir.h>
4
5namespace torch {
6namespace jit {
7
8using ModulePtr = c10::intrusive_ptr<c10::ivalue::Object>;
9
10// Given a graph with of a method which first argument is %self, lower it to a
11// graph where all attributes accesses are replaced with explicit inputs of the
12// graph (rather than results of prim::GetAttr executed on %self).
13//
14// Returns a tuple (graph, parameters) where the last module.parameters.size()
15// inputs to the graph are the trainable parameters used in this method. The
16// remaining inputs are the true inputs to the function.
17TORCH_API std::pair<std::shared_ptr<Graph>, std::vector<IValue>> LowerGraph(
18 Graph& graph,
19 const ModulePtr& self);
20
21} // namespace jit
22} // namespace torch
23