NCNN 源码剖析(二) Blob 发表于 2018-06-27 更新于 2023-05-12 分类于 CNN NCNN 中的 Blob blob 类头文件中声明如下 12345678910111213141516class Blob{public: // empty Blob();public:#if NCNN_STRING // blob name std::string name;#endif // NCNN_STRING // layer index which produce this blob as output int producer; // layer index which need this blob as input std::vector<int> consumers;} 其默认构造函数仅仅是将 producer 设置为 -1. blob 的作用是描述网络的结构。网络之间的输入输出关系。producer 声明了以这个 blob 为输出的 layer index. consumers 声明了需要这个 blob 作为输入的 layer index.