Skip to content

Commit

Permalink
Enable verbose mode and add reshape names to help diagnosing crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed May 5, 2022
1 parent 6d9cbe2 commit 4d81997
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/monotouch-test/MetalPerformanceShaders/MnistTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,23 @@ public MnistGraph (int batchSize)
this.imageSize = MnistData.ImageSize;
this.numClasses = MnistData.NumClasses;

Options = MPSGraphOptions.SynchronizeResults;// | MPSGraphOptions.Verbose;
Options = MPSGraphOptions.SynchronizeResults | MPSGraphOptions.Verbose;

Console.WriteLine (Options);

sourcePlaceholder = this.Placeholder (new [] { batchSize, imageSize * imageSize }, null);
labelsPlaceholder = this.Placeholder (new [] { batchSize, numClasses }, null);

var variables = new List<MPSGraphTensor> ();
var reshapedInput = this.Reshape (sourcePlaceholder, shape: new [] { batchSize, imageSize, imageSize, 1 }, null);
var reshapedInput = this.Reshape (sourcePlaceholder, shape: new [] { batchSize, imageSize, imageSize, 1 }, "reshapedInput");

var conv0 = AddConvLayer (reshapedInput, weightsShape: new int [4] { 5, 5, 1, 32 }, convDesc, variables);
var pool0 = this.MaxPooling2D (conv0, poolDesc, null);

var conv1Tensor = AddConvLayer (pool0, weightsShape: new int [4] { 5, 5, 32, 64 }, convDesc, variables);
var pool1Tensor = this.MaxPooling2D (conv1Tensor, poolDesc, null);

var reshape = this.Reshape (pool1Tensor, new [] { -1, 64 * 7 * 7 }, null);
var reshape = this.Reshape (pool1Tensor, new [] { -1, 64 * 7 * 7 }, "reshape");

var fc0 = AddFullyConnectedLayer (reshape, weightsShape: new int [2] { 7 * 7 * 64, 1024 }, hasActivation: true, variables);
var fc1 = AddFullyConnectedLayer (fc0, weightsShape: new int [2] { 1024, numClasses }, hasActivation: false, variables);
Expand Down

0 comments on commit 4d81997

Please sign in to comment.