Release memory after loading dataset onto device