torch.tensor和numpy
时间: 2023-09-24 15:13:16 浏览: 89
torch.tensor和numpy都是用于处理数值计算和科学计算的库。torch.tensor是PyTorch中的张量类型,用于构建多维数组。它具有多种用途和数据特点。torch.tensor可以从已有数据创建张量,可以接受Python的列表、NumPy数组或其他张量作为输入。torch.tensor还具有灵活的数据类型转换功能,可以通过指定dtype参数来设置张量的数据类型。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [第二章 Pytorch基础 Chapter 2-4 Numpy与Tensor](https://blog.csdn.net/weixin_37532614/article/details/105265086)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [【深度学习笔记】彻底理解torch中的tensor与numpy中array区别及用法](https://blog.csdn.net/DeepLearning_/article/details/127677006)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文