artificial intelligence
🦓pytorch基础题型
基础概念与张量操作1. PyTorch中的Tensor与NumPy数组的主要区别是什么?# 主要区别: # 1. Tensor可以在GPU上运行,NumPy数组只能在CPU上 # 2. Tensor支持自动求导(autograd) # 3. Tensor有更丰富的API用于深度学习 import torch import numpy as np # 相互转换 numpy_array = np.ar...