Difference between docker image from dockerhub and build from Dockerfile

Hi all,

It seems that the pyTorch docker image from dockerhub has size 3.11GB and the CUDA files (cuda.h, etc) are not inside /usr/local/, but when I build from the Dockerfile provided in repo it has size around 5 GB with all the CUDA files in expected directories. What kind of sorcery is this?