Skip to content

Commit

Permalink
show Caffe's version from MatCaffe
Browse files Browse the repository at this point in the history
  • Loading branch information
ronghanghu committed Jan 23, 2016
1 parent 19ee69d commit e94065e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions matlab/+caffe/private/caffe_.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,13 @@ static void write_mean(MEX_ARGS) {
mxFree(mean_proto_file);
}

// Usage: caffe_('version')
static void version(MEX_ARGS) {
mxCHECK(nrhs == 0, "Usage: caffe_('version')");
// Return version string
plhs[0] = mxCreateString(AS_STRING(CAFFE_VERSION));
}

/** -----------------------------------------------------------------
** Available commands.
**/
Expand Down Expand Up @@ -542,6 +549,7 @@ static handler_registry handlers[] = {
{ "reset", reset },
{ "read_mean", read_mean },
{ "write_mean", write_mean },
{ "version", version },
// The end.
{ "END", NULL },
};
Expand Down
7 changes: 7 additions & 0 deletions matlab/+caffe/version.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function version_str = version()
% version()
% show Caffe's version.

version_str = caffe_('version');

end

0 comments on commit e94065e

Please sign in to comment.