Grid search pytorch

grid search PyTorch
I am currently using ray tune but it takes up a lot of RAM I have 16GB RAM this takes up all of the memory and then my kernel gets killed.
I want to know is there another way to do grid search pytorch.
or is there a way to lower the RAM memory.