Caffe2 - C++ API
A deep learning, cross platform ML framework
shape_info.cc
1 #include "caffe2/opt/shape_info.h"
2 
3 #include "caffe2/core/operator.h"
4 
5 namespace caffe2 {
6 
7 ShapeInfo getShapeInfoFromBlob(const Blob* blob) {
8  ShapeInfo shape_info;
9  shape_info.shape = GetTensorShapeOfBlob(blob);
10  shape_info.dim_type = shape_info.shape.unknown_shape()
11  ? ShapeInfo::DimType::UNKNOWN
12  : ShapeInfo::DimType::CONSTANT;
13  return shape_info;
14 }
15 
16 bool operator==(const ShapeInfo& lhs, const ShapeInfo& rhs) {
17  return lhs.dim_type == rhs.dim_type &&
18  lhs.shape.SerializeAsString() == rhs.shape.SerializeAsString();
19 }
20 
21 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13