File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 3
3
4
4
def maxmem ():
5
5
# Check maximum memory from /proc/
6
- # Based on Python Cookbook
6
+ # Based on Python Cookbook
7
7
# 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
9
9
10
10
_scale = {'kB' : 1024.0 , 'mB' : 1024.0 * 1024.0 ,
11
11
'KB' : 1024.0 , 'MB' : 1024.0 * 1024.0 }
@@ -24,9 +24,16 @@ def maxmem():
24
24
25
25
a = np .random .random ((1024 , 1024 , 10 ))
26
26
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)
30
37
31
38
mem = maxmem () - overhead
32
39
You can’t perform that action at this time.
0 commit comments