Skip to content

Commit

Permalink
[docs] clarify the use of Blob::Reshape a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
longjon authored and shelhamer committed Sep 18, 2014
1 parent fdf2de1 commit 0b5e11d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/caffe/blob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ class Blob {
count_(0), capacity_(0) {}
explicit Blob(const int num, const int channels, const int height,
const int width);
/**
* @brief Change the dimensions of the blob, allocating new memory if
* necessary.
*
* This function can be called both to create an initial allocation
* of memory, and to adjust the dimensions of a top blob during Layer::Reshape
* or Layer::Forward. When changing the size of blob, memory will only be
* reallocated if sufficient memory does not already exist, and excess memory
* will never be freed.
*
* Note that reshaping an input blob and immediately calling Net::Backward is
* an error; either Net::Forward or Net::Reshape need to be called to
* propagate the new input shape to higher layers.
*/
void Reshape(const int num, const int channels, const int height,
const int width);
void ReshapeLike(const Blob& other);
Expand Down

0 comments on commit 0b5e11d

Please sign in to comment.