抱歉不行。即使cpu上下文将int作为输入参数 :
def cpu(device_id=0):
"""Returns a CPU context.
根据官方文件:
Parameters
----------
device_id : int, optional
The device id of the device. `device_id` is not needed for CPU.
This is included to make interface compatible with GPU.
但是,从理论上讲,由于device_id参数在那里,将来可能会更改它。但是目前,MXNet拥有所有可用的内核。
0
命令“ ctx = mx.cpu()”占用了所有可用的CPU。如何限制仅使用某个数字-说8核心中的6