Skip to content

Commit b75bb35

Browse files
add bind output as comments
1 parent 2042ad1 commit b75bb35

File tree

1 file changed

+17
-3
lines changed
  • Samples/BatchSupport/BatchSupport

1 file changed

+17
-3
lines changed

Samples/BatchSupport/BatchSupport/main.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ int main(int argc, char *argv[]) {
6363
binding.Bind(inputFeatureDescriptor.Current().Name(), inputVideoFrames);
6464
}
6565

66+
// bind output tensor, this step is optional, conmented in the sample
67+
/*
68+
auto outputShape = std::vector<int64_t>{ BATCH_SIZE, 1000, 1, 1 };
69+
auto outputValue = TensorFloat::Create(outputShape);
70+
std::wstring outputDataBindingName =
71+
std::wstring(model.OutputFeatures().First().Current().Name());
72+
binding.Bind(outputDataBindingName, outputValue);
73+
*/
74+
75+
6676
// now run the model
6777
printf("Running the model...\n");
6878
DWORD ticks = GetTickCount();
@@ -71,10 +81,14 @@ int main(int argc, char *argv[]) {
7181
printf("model run took %d ticks\n", ticks);
7282

7383
// Print Results
74-
auto outputs = results.Outputs().Lookup(L"softmaxout_1").as<TensorFloat>(); // Get outputs by output name
75-
auto outputShape = outputs.Shape();
84+
85+
// conment three lines below if bind output
86+
auto outputValue = results.Outputs().Lookup(L"softmaxout_1").as<TensorFloat>(); // Get outputs by output name
87+
auto outputShape = outputValue.Shape();
7688
printf("output dimensions [%d, %d, %d, %d]\n", outputShape.GetAt(0), outputShape.GetAt(1), outputShape.GetAt(2), outputShape.GetAt(3));
77-
SampleHelper::PrintResults(outputs.GetAsVectorView());
89+
// conment three lines above if bind output
90+
91+
SampleHelper::PrintResults(outputValue.GetAsVectorView());
7892
}
7993

8094
bool ParseArgs(int argc, char *argv[]) {

0 commit comments

Comments
 (0)