Caffe2 - C++ API
A deep learning, cross platform ML framework
shape_info.h
1 #pragma once
2 
3 #include "caffe2/core/operator.h"
4 
5 namespace caffe2 {
6 
7 struct CAFFE2_API ShapeInfo {
8  enum DimType : int8_t { UNKNOWN = 0, CONSTANT = 1, BATCH = 2, SEQ = 3 };
9  ShapeInfo() {}
10  ShapeInfo(DimType t, TensorShape&& s) : dim_type(t), shape(std::move(s)) {}
11  ShapeInfo(DimType t, const TensorShape& s) : dim_type(t), shape(s) {}
12 
13  // type of the shape according its first dim
14  DimType dim_type{DimType::UNKNOWN};
15  TensorShape shape;
16 };
17 
18 using ShapeInfoMap = std::unordered_map<std::string, ShapeInfo>;
19 
20 // Generates ShapeInfo from Blob.
21 ShapeInfo getShapeInfoFromBlob(const Blob* blob);
22 
23 bool operator==(const ShapeInfo& lhs, const ShapeInfo& rhs);
24 
25 } // namespace caffe2
Blob is a general container that hosts a typed pointer.
Definition: blob.h:24
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13