Tencent / TNN

TNN: developed by Tencent Youtu Lab and Guangying Lab, a uniform deep learning inference framework for mobile、desktop and server. TNN is distinguished by several outstanding features, including its cross-platform capability, high performance, model compression and code pruning. Based on ncnn and Rapidnet, TNN further strengthens the support and performance optimization for mobile devices, and also draws on the advantages of good extensibility and high performance from existed open source efforts. TNN has been deployed in multiple Apps from Tencent, such as Mobile QQ, Weishi, Pitu, etc. Contributions are welcome to work in collaborative with us and make TNN a better framework.
Other
4.38k stars 766 forks source link

bytes_offset的实际意义 #1916

Open kache1995 opened 1 year ago

kache1995 commented 1 year ago

你好,我想问一下bytes_offset的实际意义: 我转了一个fp16的浮点模型(onnx->tnn); 在本地Ubuntu跑的时候,我打印bytes_offset=0 在手机(armv8a-64)上跑cpu的时候,打印bytes_offset=16。

我李姐bytes_offset应该指的是我一个元素所占字节的大小,看样子似乎不是这样。bytes_offset究竟是一个元素占字节大小,还是只一个元素有多少位?为什么pc上跑bytes_offset=0呢?

还有加tnn的群一直进不去?

darrenyao87 commented 1 year ago

bytes_offset是内部内存管理的一种机制,有的device下为了效率,内存不是一个tensor一个tensor单独分配而是一起计算出大小后,通过bytes_offset来确定tensor的起始位置。