xref: /aosp_15_r20/external/pytorch/torch/csrc/lazy/core/ir_dump_util.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <torch/csrc/lazy/core/ir.h>
4 
5 #include <string>
6 
7 namespace torch {
8 namespace lazy {
9 
10 class BackendDevice;
11 
12 class TORCH_API DumpUtil {
13  public:
14   static std::string ToDot(c10::ArrayRef<const Node*> nodes);
15 
16   static std::string PostOrderToDot(
17       c10::ArrayRef<const Node*> post_order,
18       c10::ArrayRef<const Node*> roots);
19 
20   static std::string ToText(c10::ArrayRef<const Node*> nodes);
21 
22   static std::string PostOrderToText(
23       c10::ArrayRef<const Node*> post_order,
24       c10::ArrayRef<const Node*> roots);
25 
26   static std::string ToBackend(
27       c10::ArrayRef<Value> values,
28       const BackendDevice& device);
29 };
30 
31 } // namespace lazy
32 } // namespace torch
33