Check gpuArray double or single?
Ältere Kommentare anzeigen
I'm pretty sure a gpuArray has a type (e.g., single or double). But i'm not sure how to check it. The function isa does not work for gpuArray.
A = gpuArray(single(1));
B = gpuArray(double(1));
isa(B,'double')
isa(B,'single')
You get both 0s.
Ref: https://www.mathworks.com/help/matlab/ref/isa.html
Thanks!
Antworten (1)
Steven Lord
am 27 Nov. 2017
2 Stimmen
The isa function works fine, but it answers a different question than you want to be answered. Instead, ask your question using the classUnderlying function.
2 Kommentare
Joss Knight
am 27 Nov. 2017
isaUnderlying is the direct analogue.
Steven Lord
am 27 Nov. 2017
Right, classUnderlying came to my mind first and I forgot to check for a function that is to isa like classUnderlying is to class. Use isaUnderlying as Joss suggested.
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!