void Blob<Dtype>::Reshape(const BlobShape& shape) { CHECK_LE(shape.dim_size(), kMaxBlobAxes); vector<int> shape_vec(shape.dim_size()); for (int i = 0; i < shape.dim_size(); ++i) { shape_vec[i] = shape.dim(i); } Reshape(shape_vec); }
const vector<int> NDimDataLayer<Dtype>::blob2vec(const BlobShape& b) const { CHECK_LE(b.dim_size(), kMaxBlobAxes); vector<int> shape_vec(b.dim_size()); for (int i = 0, n = b.dim_size(); i < n; ++i) { shape_vec[i] = b.dim(i); } return shape_vec; }
void Blob<Dtype>::reshape(const BlobShape& blob_shape) { vector<int> shape(blob_shape.dim_size()); for (int i = 0; i < shape.size(); i++) shape[i] = blob_shape.dim(i); reshape(shape); }