I was curious as to how to do this?
import torch.multiprocessing as mp
from pytorch3d.ops import sample_points_from_meshes
def Sample(mesh_obj,n_points,device):
  return sample_points_from_meshes(mesh_obj,n_points).to(device)
def creator_parallel(mesh_obj:Meshes,n_points:int,length:int):
  num_of_processes = length
  mesh_obj.share_memory() #main requirement
  processes = []
  for rank in range(num_of_processes):
    p = mp.Process(target=Sample,args=(mesh_obj,n_points,device))
    p.start()
    processes.append(p)
  for p in processes:
      p.join()
  
creator_parallel(trg_mesh,1000,50)