xref: /aosp_15_r20/external/pytorch/torch/csrc/jit/passes/utils/check_alias_annotation.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <ATen/core/ivalue.h>
4 #include <torch/csrc/jit/ir/ir.h>
5 #include <memory>
6 #include <string>
7 #include <vector>
8 
9 namespace torch {
10 namespace jit {
11 
12 // Verify that alias annotations are correct. See impl for definition of
13 // "correct".
14 //
15 // This function expects a graph with a single op with `unqualifiedOpName`, plus
16 // the inputs that you would otherwise have passed to the graph executor.
17 TORCH_API void checkAliasAnnotation(
18     const std::shared_ptr<Graph>& graph,
19     std::vector<IValue> pythonInputs,
20     const std::string& unqualifiedOpName);
21 } // namespace jit
22 } // namespace torch
23