转载自:http://iyenn.com/rec/1702306.html
尊重原创,请读原文。
inputs = Variable(torch.randn(2,2))
inputs.is_cuda # will return false
inputs = Variable(torch.randn(2,2).cuda())
inputs.is_cuda # returns true
- 1
- 2
- 3
- 4
判断变量类型:下面两种方法都行
if isinstance(downsample, torch.nn.Module):
# if torch.type(downsample) != torch.IntTensor:
- 1
- 2
文章知识点与官方知识档案匹配,可进一步学习相关知识
Python入门技能树人工智能深度学习416686 人正在系统学习中
评论记录:
回复评论: