Did you make sure to call model.eval() before running the comparison?
This will make sure to disable dropout layers and use the running stats from batchnorm layers instead of the current batch statistic.
Also, note that some operations include atomicAdd as described here 1, which will not yield deterministic results.