reid from https://github.com/michuanhaohao/reid-strong-baseline
zhangmeng
2020-01-10 c3765bd24fe73747688a0ec2a550f219c9acb384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
 
#include <ATen/core/jit_type.h>
#include <ATen/core/alias_info.h>
#include <torch/csrc/jit/script/lexer.h>
#include <ATen/core/Macros.h>
 
namespace torch {
namespace jit {
namespace script {
 
using TypePtr = c10::TypePtr;
using TypeAndAlias = std::pair<TypePtr, c10::optional<c10::AliasInfo>>;
 
struct CAFFE2_API SchemaTypeParser {
  TypeAndAlias parseBaseType();
  c10::optional<c10::AliasInfo> parseAliasAnnotation();
  std::pair<TypePtr, c10::optional<c10::AliasInfo>> parseType();
  c10::optional<at::ScalarType> parseTensorDType(const std::string& dtype);
  TypePtr parseRefinedTensor();
 
  SchemaTypeParser(Lexer& L, bool parse_complete_tensor_types) : L(L) {
    complete_tensor_types = parse_complete_tensor_types;
  }
 
 private:
  void parseList(
      int begin,
      int sep,
      int end,
      const std::function<void()>& callback);
 
  bool complete_tensor_types;
  Lexer& L;
  size_t next_id = 0;
};
} // namespace script
} // namespace jit
} // namespace torch