The argmax operation should detach the tensor from the computation graph and would yield this error.
I’m not familiar with this particular blog post, but @halahup is also active here in the forum, so he might correct me.