2016-08-30 4 views

ответ

1

:type() Использование тензорные в:

cutorch = require('cutorch') 

x = torch.Tensor(3,3) 
x = x:cuda() 

if x:type() == 'torch.CudaTensor' then 
    print('x is CUDA tensor') 
else 
    print('x is normal tensor') 
end