背景
公司内部的基于torch的toolbox发现某个版本之后,结果发生了偏移. 通过一系列排查,发现当导入cupy和torch的顺序不同时,计算结果会有所差异。 也就是说,如下两段代码会导致模型训练等环节的计算得到不同的结果.
阅读更多背景
需要使用bazel build onnxruntime
但是onnxruntime本身没有提供bazel相关的配置
作为单独的repo
将onnxruntime的包下载下来解压
主要的坑点在于动态库必须写全版本号,不然无法成功导入 完整的BUILD.bazel文件为
阅读更多背景
2022年惊讶的发现,当时竟然没有写关于softmax的笔记,因此来补充一下。
proto
还是先看proto
1 2// Message that stores parameters used by SoftmaxLayer, SoftmaxWithLossLayer 3message SoftmaxParameter { 4 enum Engine { 5 DEFAULT = 0; 6 CAFFE = 1; 7 CUDNN = 2; 8 } 9 optional Engine engine = 1 [default = DEFAULT]; 10 11 // The axis …
阅读更多背景
每一个cpp expression都有一个type 和 value category 属性 前者大家都比较了解,但是后者却常常被忽视
Value Categories in the c language
cpp是由c语言发展而来,因此这里先介绍c 语言中的value category
阅读更多最近在做一个智能算力的项目,其中需要用到redis维护某个全局的时间窗口
资料
复杂数据结构的表示方式
学习过程中唯一让我迷惑的是一个嵌套的数据结构要如何表示 比如我想表示一个key为string, value为List的Hash 按照c++的语法,也就是一个
阅读更多接口
一个ABC,后面会继承这个类做各种实现
clean up function
代码比较好懂,唯一让我感到疑惑的是 clean up function 这部分
1 2 // FIXME: 不太理解为什么需要很多个clean up function 3 // Cleanup functions are stored in a single-linked list. 4 // The list's head node is inlined in the iterator. 5 struct CleanupNode { 6 // True if the node is not used. Only …
阅读更多arena时levelDB中的内存池实现
接口
没有太多好说的,都非常直观。 补了些注释
1 2class Arena { 3 public: 4 Arena(); 5 6 Arena(const Arena&) = delete; 7 Arena& operator=(const Arena&) = delete; 8 9 ~Arena(); 10 11 // Return a pointer to a newly allocated memory block of "bytes" bytes. 12 char* Allocate(size_t bytes); …
阅读更多FilterPolicy接口
1 2class LEVELDB_EXPORT FilterPolicy { 3 public: 4 virtual ~FilterPolicy(); 5 6 // Return the name of this policy. Note that if the filter encoding 7 // changes in an incompatible way, the name returned by this method 8 // must be changed. Otherwise, old incompatible filters may be 9 // …
阅读更多