gpt4 book ai didi

python - C-contiguous fashion在caffe blob存储中意味着什么?

转载 作者:太空狗 更新时间:2023-10-29 20:43:22 25 4
gpt4 key购买 nike

在caffe文档中:http://caffe.berkeleyvision.org/tutorial/net_layer_blob.html

Blob storage and communication# A Blob is a wrapper over the actual data being processed and passed along by Caffe, and also under the hood provides synchronization capability between the CPU and the GPU. Mathematically, a blob is an N-dimensional array stored in a C-contiguous fashion.

它表示 blob 以C 连续方式 存储。 C-contiguous fashion 是什么意思?

最佳答案

C 连续方式,与 Fortran 方式(也被 Matlab 使用)相反。这意味着 n-dim 数据在内存中存储为一个长且连续的数组。元素在内存中的顺序是按照 C 风格:尾部维度先存储。也就是说,如果你有 c x h x w 3d blob,内存中的行将一个接一个地保存,并且在完成第一个 channel 的所有行之后,才写入下一个 channel 的行。

另一种看待它的方式是i,j,k元素存储在

  blob[i*w*h + j*w + k]

参见 this wiki page获取更多信息。

关于python - C-contiguous fashion在caffe blob存储中意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37597814/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com