I'm wondering how to optimize the functions generate_soft_embed() and sample_soft_embed() in model.py. Right now, we loop over the mini-batch sequentially, which is extremely slow. On the other hand, there doesn't seem to be an intuitive way to parallelize this. Any ideas?
I'm wondering how to optimize the functions
generate_soft_embed()
andsample_soft_embed()
inmodel.py
. Right now, we loop over the mini-batch sequentially, which is extremely slow. On the other hand, there doesn't seem to be an intuitive way to parallelize this. Any ideas?