- 10
- 0
- 约1.67万字
- 约 36页
- 2026-07-27 发布于山西
- 举报
2026年人工智能训练师(一级)实操综合真题题库
2026年人工智能训练师(一级)实操综合真题题库
1.单选题(每题1分,共20分)
1.1在PyTorch2.3中,以下哪段代码可以正确地把4张2080×2080的RGB图像以bfloat16精度、NCHW格式、零拷贝方式送入CUDA显存,并确保后续autograd图不中断?
A.`torch.as_tensor(np.stack(imgs),dtype=torch.bfloat16,device=cuda).requires_grad_()`
B.`torch.from_numpy(np.stack(imgs)).to(dtype=torch.bfloat16,device=cuda).detach().requires_grad_()`
C.`torch.empty((4,3,2080,2080),dtype=torch.bfloat16,device=cuda).copy_(torch.from_numpy(np.stack(imgs)))`
D.`torch.from_numpy(np.stack(imgs)).pin_memory().to(dtype=torch.bfloat16,device=cuda,non_blocking=True).requires_grad_()`
答案:D
解析:A
原创力文档

文档评论(0)