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
35 lines (28 loc) · 897 Bytes
/
Program.cs
File metadata and controls
35 lines (28 loc) · 897 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
34
35
using System;
using static Tensorflow.Binding;
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 68M.
mm.Execute(10, 100 * batchSize, cases.Constant);
// 100K float variable 84M.
mm.Execute(10, 10 * batchSize, cases.Variable);
// 1 million math add 39M.
mm.Execute(10, 100 * batchSize, cases.MathAdd);
// 100K gradient 44M.
mm.Execute(10, 10 * batchSize, cases.Gradient);
// 95M
Console.WriteLine("Finished.");
Console.ReadLine();
}
}
}