If you need to call a numpy method e.g. since there is no corresponding method in PyTorch, your workflow is correct. The no_grad() wrapper wouldn’t change anything, which was the initial question, since Autograd won’t track any numpy operations.
You can still use the processing in the forward method, but note that you would use the CPU (since numpy cannot use the GPU) and would then add synchronizations by transferring the tensor to the CPU first before calling numpy.
That being said, functionality-wise your approach should work, the performance could potentially be improved if you could stay on the GPU and use PyTorch methods to process the target.