move data into CUDA:
cudafy = lambda x : x if cuda is None else x.cuda(cuda)
cudafy(model)
convert data from tensor (in GPU) to numpy (in cpu):
torch2np = lambda x : x.cpu().detach().numpy()
move data into CUDA:
cudafy = lambda x : x if cuda is None else x.cuda(cuda)
cudafy(model)
convert data from tensor (in GPU) to numpy (in cpu):
torch2np = lambda x : x.cpu().detach().numpy()