Pytorch equivalent of tf.map_fn with parallel_iterations?
I'm executing a PyTorch function for n_iters times on a GPU. Currently I'm using a for loop for this. However, when n_iters is large, this is very inefficient. I'm wondering whether there is a PyTorch equivalent of tf.map_fn with the parallel_iterations functionality so that I can execute all the iterations in parallel?

I have searched intensively and I was not able to find any function in pytorch thats equivalent to tf.map_fn that exposes number of parallel_iterations to be set by the user. 

While exploring, I have found that there is a function named 'nn.DataParallel' but this function replicates the model or the operation that you want to run on multiple gpus and then returns the results which is not equivalent to number of parallel_iterations in tf.map_fn.

But for now in Pytorch, using the for loop is the only way to go right now.
