@@ -63,12 +63,15 @@ int main(int argc, char *argv[]) {
6363 binding.Bind (inputFeatureDescriptor.Current ().Name (), inputVideoFrames);
6464 }
6565
66- // bind output tensor
67- auto outputShape = std::vector<int64_t >{BATCH_SIZE, 1000 , 1 , 1 };
66+ // bind output tensor, this step is optional, conmented out in the sample
67+ /*
68+ auto outputShape = std::vector<int64_t>{ BATCH_SIZE, 1000, 1, 1 };
6869 auto outputValue = TensorFloat::Create(outputShape);
6970 std::wstring outputDataBindingName =
70- std::wstring (model.OutputFeatures ().First ().Current ().Name ());
71+ std::wstring(model.OutputFeatures().First().Current().Name());
7172 binding.Bind(outputDataBindingName, outputValue);
73+ */
74+
7275
7376 // now run the model
7477 printf (" Running the model...\n " );
@@ -78,6 +81,13 @@ int main(int argc, char *argv[]) {
7881 printf (" model run took %d ticks\n " , ticks);
7982
8083 // Print Results
84+
85+ // conment out 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 ();
88+ printf (" output dimensions [%d, %d, %d, %d]\n " , outputShape.GetAt (0 ), outputShape.GetAt (1 ), outputShape.GetAt (2 ), outputShape.GetAt (3 ));
89+ // conment out three lines above if bind output
90+
8191 SampleHelper::PrintResults (outputValue.GetAsVectorView ());
8292}
8393
0 commit comments