import torch
while True:
a = torch.zeros(100000)
This is my test code for monitoring CPU utilization, when I monitor top command I see this process is consuming 100% cpu (one full core), which is pretty reasonable.
However, when I change 100000 to 200000, TOP shows that this process is consuming 400% cpu resource (4 full cores). I don’t know how zeros implement it and why it will consume so much cpu resource.