What does C-contiguous mod mean in caffe blob repository?

in caffe doc: http://caffe.berkeleyvision.org/tutorial/net_layer_blob.html

Saving memory and communication # Blob is a wrapper over the actual data being processed and is transferred to Caffe, and also under the hood it provides the ability to synchronize between the CPU and the GPU. Mathematically, blob is an N-dimensional array stored in C-contiguous mode.

he said blob is stored in C-contiguous mode . What does C-related style mean?

+5
source share
1 answer

C continuous, the opposite of Fortran mode (also used by Matlab). This means that n-dimensional data is stored as a long and continuous array in memory. The order of the elements in memory depends on mode C: first, the final dimensions are saved. That is, if you have c by h by w 3d blob, they will be saved one by one in the memory cells, and after the completion of all lines of the first channel, only the lines of the next channel are recorded.

Another way to look at this is that the element i, j, k is stored in

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

See this viking page for more details.

+11
source

All Articles