Caffe2 - C++ API
A deep learning, cross platform ML framework
parser.h
1 #pragma once
2 #include <torch/csrc/WindowsTorchApiMacro.h>
3 #include <torch/csrc/jit/script/tree.h>
4 #include <torch/csrc/jit/script/tree_views.h>
5 #include <memory>
6 
7 namespace torch {
8 namespace jit {
9 namespace script {
10 
11 struct Decl;
12 struct ParserImpl;
13 struct Lexer;
14 
15 TORCH_API Decl mergeTypesFromTypeComment(
16  const Decl& decl,
17  const Decl& type_annotation_decl,
18  bool is_method);
19 
20 struct TORCH_API Parser {
21  explicit Parser(const std::string& str);
22  TreeRef parseFunction(bool is_method);
23  TreeRef parseClass();
24  Decl parseTypeComment();
25  Expr parseExp();
26  Lexer& lexer();
27  ~Parser();
28 
29  private:
30  std::unique_ptr<ParserImpl> pImpl;
31 };
32 
33 } // namespace script
34 } // namespace jit
35 } // namespace torch
Definition: jit_type.h:17