Which PyTorch version are you using?
As far as I know, torch.argmax was introduced in 0.4.0.
If you have an older version, you could update to the latest stable release following these instructions 2 or use:
_, idx = torch.max(a, 1)