We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6577760 + 32eb0a7 commit e4397c4Copy full SHA for e4397c4
python/paddle/v2/__init__.py
@@ -91,14 +91,14 @@ def num_physical_cores():
91
.read())
92
return num_sockets * num_cores_per_socket
93
else:
94
- cmds = {"Darwin": "sysctl hw.physicalcpu"}
+ cmds = {"Darwin": "sysctl -n hw.physicalcpu"}
95
return int(os.popen(cmds.get(platform.system(), "expr 1")).read())
96
97
def num_logical_processors():
98
'''Get the number of logical processors'''
99
cmds = {
100
"Linux": "grep \"processor\" /proc/cpuinfo|sort -u|wc -l",
101
- "Darwin": "sysctl hw.logicalcpu"
+ "Darwin": "sysctl -n hw.logicalcpu"
102
}
103
104
0 commit comments