function to modify the gpu trained code run on CPU