diff options
Diffstat (limited to 'samples/SimpleSample.cpp')
-rw-r--r-- | samples/SimpleSample.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/samples/SimpleSample.cpp b/samples/SimpleSample.cpp index 6bdc2983bb..3f94b53ca1 100644 --- a/samples/SimpleSample.cpp +++ b/samples/SimpleSample.cpp @@ -29,6 +29,7 @@ int main() float weightsData[] = {1.0f}; // Identity TensorInfo weightsInfo(TensorShape({1, 1}), DataType::Float32); + weightsInfo.SetConstant(); ConstTensor weights(weightsInfo, weightsData); // Constant layer that now holds weights data for FullyConnected @@ -54,7 +55,7 @@ int main() TensorInfo outputTensorInfo(TensorShape({1, 1}), DataType::Float32); fullyConnectedLayer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo); - constantWeightsLayer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo); + constantWeightsLayer->GetOutputSlot(0).SetTensorInfo(weightsInfo); // Optimise ArmNN network IOptimizedNetworkPtr optNet = Optimize(*myNetwork, {Compute::CpuRef}, run->GetDeviceSpec()); |