此部分代码在Apple M1的Pytorch环境中运行会报Could not initialize NNPACK! Reason: Unsupported hardware.错误提示,解决办法如下:
mps_device = torch.device("mps")
output = conv_layer(input).to(mps_device)
程序将使用M1的GPU正常运行。
此部分代码在Apple M1的Pytorch环境中运行会报Could not initialize NNPACK! Reason: Unsupported hardware.错误提示,解决办法如下:
mps_device = torch.device("mps")
output = conv_layer(input).to(mps_device)
程序将使用M1的GPU正常运行。