ONE - On-device Neural Engine
Loading...
Searching...
No Matches
caffeimport::WeightContext Class Reference

#include <Context.h>

Public Member Functions

 WeightContext (::caffe::NetParameter *caffemodel)
 
int blob_count (const LayerName &name)
 
::caffe::BlobProto * blob_get (const LayerName &name, uint32_t n)
 

Detailed Description

Definition at line 38 of file Context.h.

Constructor & Destructor Documentation

◆ WeightContext()

caffeimport::WeightContext::WeightContext ( ::caffe::NetParameter *  caffemodel)
inline

Definition at line 41 of file Context.h.

41 : _caffemodel(caffemodel)
42 {
43 for (uint32_t n = 0; n < _caffemodel->layer_size(); ++n)
44 {
45 auto layer = _caffemodel->mutable_layer(n);
46
47 if (layer->has_name())
48 {
49 _data[layer->name()] = layer;
50 }
51 }
52 }

Member Function Documentation

◆ blob_count()

int caffeimport::WeightContext::blob_count ( const LayerName name)
inline

Definition at line 55 of file Context.h.

56 {
57 if (_data.find(name) != _data.end())
58 return _data.at(name)->blobs_size();
59
60 assert(false);
61 return 0;
62 }

Referenced by caffeimport::BatchNormBuilder::build(), caffeimport::ConvolutionBuilder::build(), and caffeimport::ScaleBuilder::build().

◆ blob_get()

::caffe::BlobProto * caffeimport::WeightContext::blob_get ( const LayerName name,
uint32_t  n 
)
inline

Definition at line 64 of file Context.h.

65 {
66 if (_data.find(name) != _data.end())
67 return _data.at(name)->mutable_blobs(n);
68
69 assert(false);
70 return nullptr;
71 };

Referenced by caffeimport::BatchNormBuilder::build(), caffeimport::ConvolutionBuilder::build(), and caffeimport::ScaleBuilder::build().


The documentation for this class was generated from the following file: