Python torch.argmax()怎么使用
发表于:2024-10-25 作者:千家信息网编辑
千家信息网最后更新 2024年10月25日,本篇内容主要讲解"Python torch.argmax()怎么使用",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Python torch.argmax(
千家信息网最后更新 2024年10月25日Python torch.argmax()怎么使用
本篇内容主要讲解"Python torch.argmax()怎么使用",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Python torch.argmax()怎么使用"吧!
代码实验展示:
Microsoft Windows [版本 10.0.18363.1256](c) 2019 Microsoft Corporation。保留所有权利。C:\Users\chenxuqi>conda activate ssd4pytorch2_2_0(ssd4pytorch2_2_0) C:\Users\chenxuqi>pythonPython 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32Type "help", "copyright", "credits" or "license" for more information.>>> import torch>>> torch.manual_seed(seed=20200910)>>>>>> a = torch.randn(4, 4)>>> atensor([[ 0.5816, 2.0060, 1.6013, -0.6379],[-1.1943, 0.1426, 1.3612, -1.4171],[-2.7679, 2.1961, 1.3462, -0.7650],[ 1.5528, 0.7210, -0.1314, 0.1448]])>>> torch.argmax(a)tensor(9)>>>>>> torch.manual_seed(seed=20200910) >>>>>> a = torch.randn(4, 5)>>> torch.argmax(a, dim=1)tensor([1, 3, 1, 4])>>> torch.argmax(a, dim=0)tensor([2, 2, 0, 1, 3])>>> atensor([[ 0.5816, 2.0060, 1.6013, -0.6379, -0.4996],[ 0.2791, -0.5900, 0.2527, 0.2797, -0.5316],[ 0.6480, 2.6538, -0.2797, -1.3232, -0.8263],[-0.4343, -0.2370, -1.7016, -0.2565, 1.4568]])>>>>>>>>>
到此,相信大家对"Python torch.argmax()怎么使用"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
内容
学习
实用
更深
代码
兴趣
实用性
实际
操作简单
方法
更多
朋友
权利
版本
网站
频道
实验
查询
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
联机必须要服务器吗
平顶山erp软件开发
舒服务器
流放者柯南服务器不加载mod
软件开发商的解释
倩女幽魂手游服务器哪个好
数据库读取数据
无锡锡山大华智能服务器安装
电子表格服务器哪个好
网络安全问题真实案例
软件开发技术性能指标
csgo 查看服务器
在服务器里装jdk
拉朋网络技术
软件开发定制哪家专业
网络技术是物联网技术吗
咸阳软件开发培训学校
网络安全卫士翻译
北京文档软件开发价格
在苏州去哪里学软件开发
房友数据库怎么安装
京东服务器怎么接入
杭州节能软件开发多少钱
网络安全防护的概述
计算机网络技术能否报名士官
中国云服务器有用吗
一个办公室有几台服务器
软件开发什么工作
软件开发及技术服务
杜兰特一球打爆服务器抢七