Skip to content

Commit de0e2f9

Browse files
committed
Improve progression of the example expression
1 parent 1ebd237 commit de0e2f9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

demos/memory_usage.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
def maxmem():
55
# Check maximum memory from /proc/
6-
# Based on Python Cookbook
6+
# Based on Python Cookbook
77
# http://code.activestate.com/recipes/286222/
8-
# Works on most Linux systems but not in Mac OSX or Windows
8+
# Works on most Linux systems but not in Mac OSX or Windows
99

1010
_scale = {'kB': 1024.0, 'mB': 1024.0 * 1024.0,
1111
'KB': 1024.0, 'MB': 1024.0 * 1024.0}
@@ -24,9 +24,16 @@ def maxmem():
2424

2525
a = np.random.random((1024, 1024, 10))
2626
b = np.random.random((1024, 1024, 10))
27-
c = a + b
28-
# c = 1.2*np.cos(b) + 1.2*np.sin(a) + (2.0*a + 3.0*b)
29-
27+
c = a - b
28+
#c = 2.0 * a - 4.5 * b
29+
#c = 2.0 * a - 4.5 * b + np.sin(a) - np.cos(b)
30+
#c = 2.0 * a - 4.5 * b + (np.sin(a) - np.cos(b))
31+
#c = (np.sin(a) - np.cos(b)) + 2.0 * a - 4.5 * b
32+
33+
#c = 2.0 * a
34+
#c -= 4.5 * b
35+
#c += np.sin(a)
36+
#c -= np.cos(b)
3037

3138
mem = maxmem() - overhead
3239

0 commit comments

Comments
 (0)