深度学习mindspore --- 程序为何不能同时兼容cpu和gpu。

         前面在安装mindspore的时候,我有说过。只有那个lenet程序是支持win10 ,cpu版本的。

         看程序的时候,你会看到这个程序段。就是选择GPU,CPU,还是Ascend。可是tensorflow就不涉及程序问题。而是自动优化选择的。

 parser.add_argument('--device_target', type=str, default="CPU", choices=['Ascend', 'GPU', 'CPU'],
                        help='device where the code will be implemented (default: CPU)')

      这里是算子支持的情况。    

深度学习mindspore --- 程序为何不能同时兼容cpu和gpu。_第1张图片

     就是因为程序使用的算子,并不支持某些器件。

     如果说某个程序支持gpu,但是不支持cpu。只要把只支持GPU的算子换成cpu算子也就可以了。

 

 

你可能感兴趣的:(深度学习mindspore,python,tensorflow,mindspore,深度学习)