xref: /aosp_15_r20/external/pytorch/torch/csrc/jit/passes/onnx/naming.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <torch/csrc/jit/ir/ir.h>
4 
5 namespace torch::jit::onnx {
6 
7 namespace ONNXScopeName {
8 
9 std::string createFullScopeName(
10     const std::string& class_name,
11     const std::string& variable_name);
12 std::string variableName(torch::jit::ScopePtr scope);
13 std::string variableNameFromRoot(
14     const torch::jit::ScopePtr& scope,
15     const std::string& layer_separator);
16 std::string className(torch::jit::ScopePtr scope);
17 std::string classNameFromRoot(
18     const torch::jit::ScopePtr& scope,
19     const std::string& layer_separator);
20 bool isCompatibleScope(const torch::jit::ScopePtr& scope);
21 
22 } // namespace ONNXScopeName
23 
24 TORCH_API void AssignScopedNamesForNodeAndValue(std::shared_ptr<Graph>& graph);
25 
26 } // namespace torch::jit::onnx
27