The API has changed considerably (this looks like pre-0.4 code btw.), as your code looks more like the C backend of Torch7 (which is the starting point for PyTorch, but the API is much more modern).
Basically, the types TH*Tensor all become Tensor. Then TORCH_CHECK with args replaces THArgCheck. Functions TH*Tensor_foo(input, ...) typically are methods input.foo(...).
But you’ll have to fill in the details yourself ro use the pre-made NMS from TorchVision.
Best regards
Thomas