forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (26 loc) · 852 Bytes
/
Program.cs
File metadata and controls
33 lines (26 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
namespace Tensorflow
{
class Program
{
static void Main(string[] args)
{
// boot .net core 10.5M.
var mm = new MemoryMonitor();
// warm up tensorflow.net 28.5M.
mm.WarmUp();
var cases = new MemoryTestingCases();
int batchSize = 1000;
// 1 million float tensor 58.5M.
mm.Execute(10, 100 * batchSize, cases.Constant);
// 100K float variable 80.5M.
mm.Execute(10, 10 * batchSize, cases.Variable);
// 1 million math add 36.5M.
mm.Execute(10, 100 * batchSize, cases.MathAdd);
// 100K gradient 210M.
mm.Execute(10, 10 * batchSize, cases.Gradient);
Console.WriteLine("Finished.");
Console.ReadLine();
}
}
}