Before transfer the data to gpu