Sami: fixed for the case of not using gpu