/// <summary> /// Handle CNTK exceptions. /// </summary> /// <param name="ex">The exception to be handled.</param> private static void OnCNTKException(CNTKException ex) { // The pattern "Inner Exception" is used by End2EndTests to catch test failure. Console.WriteLine("Error: {0}\nNative CallStack: {1}\n Inner Exception: {2}", ex.Message, ex.NativeCallStack, ex.InnerException != null ? ex.InnerException.Message : "No Inner Exception"); throw ex; }