フィルターのクリア

Run GPU code only on CPU: How to get rid of gpuArray data?

2 ビュー (過去 30 日間)
Prb
Prb 2019 年 5 月 14 日
コメント済み: Prb 2019 年 5 月 15 日
Hi I have this piece of deep learning code which runs on GPU. I wish not to use GPU. How can I change the code to run only on CPU or just to use it as Array.
eg:
B_forward = gpuArray(X_test(:,:,:,ThisInds));
if size(Residuals,1) > size(B_forward,1)
NewRes = int8(zeros(size(B_forward),'gpuArray'));
end
if Shifts(WeightLayerIndex) ~= 0
B_forward = gpuArray(bitshift(gather(B_forward),Shifts(WeightLayerIndex)));
end

採用された回答

Walter Roberson
Walter Roberson 2019 年 5 月 14 日
B_forward = (X_test(:,:,:,ThisInds));
if size(Residuals,1) > size(B_forward,1)
NewRes = int8(zeros(size(B_forward)));
end
if Shifts(WeightLayerIndex) ~= 0
B_forward = (bitshift((B_forward),Shifts(WeightLayerIndex)));
end
  1 件のコメント
Prb
Prb 2019 年 5 月 15 日
thanks for the answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGPU Computing in MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by