Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix the problem in printing feature in c++ API examples : feature_ext…
Browse files Browse the repository at this point in the history
…ract (#15686)

* fix the problem in printing feature vectors.

Fixed a run-time error caused by mismatch of output dimensions.

* ci

* ci

* ci

* ci
  • Loading branch information
somone23412 authored and wkcn committed Nov 26, 2019
1 parent 6c7ce24 commit c9585bd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cpp-package/example/feature_extract/feature_extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class FeatureExtractor {
/*print out the features*/
auto array = executor->outputs[0].Copy(Context(kCPU, 0));
NDArray::WaitAll();
array = array.Reshape({2, 1024});
for (int i = 0; i < 1024; ++i) {
cout << array.At(0, i) << ",";
}
Expand Down

0 comments on commit c9585bd

Please sign in to comment.