当前位置: 首页 > news >正文

网站301重定向代码企业采购

网站301重定向代码,企业采购,怎么样网站泛解析,拼音头饰手工制作图片torch.set_printoptions 设置pytorch打印张量时的选项#xff0c;比如限制打印的元素数量、设置精度等。在打印大张量或者需要更精确控制输出格式时非常有用。 torch.set_printoptions(precisionNone, thresholdNone, edgeitemsNone, linewidthNone, profileNone, sci_modeN…torch.set_printoptions 设置pytorch打印张量时的选项比如限制打印的元素数量、设置精度等。在打印大张量或者需要更精确控制输出格式时非常有用。 torch.set_printoptions(precisionNone, thresholdNone, edgeitemsNone, linewidthNone, profileNone, sci_modeNone) precision – 浮点输出的精度位数默认值 4。threshold – 输出的数组元素总数默认值 1000。edgeitems – 每个维度开头和结尾的元素数 默认值 3。linewidth – 用于插入换行符的每行字符数默认值 80。profile – 打印选项。可被上述任何选项覆盖。三个选项default、short、fullsci_mode – 启用 True 或禁用 False 科学记数法。 示例 1设置打印的元素数量 import torch # 创建一个大张量 big_tensor torch.randn(1000, 1000) # 设置打印选项限制每行打印的元素数量为5 torch.set_printoptions(edgeitems5) # 打印大张量 print(big_tensor) output tensor([[ 7.096e-01, -2.319e-01, -3.508e-01, -1.490e00, -2.094e00, ..., 2.418e00,2.191e00, -1.097e00, -8.462e-03, 1.543e00],[-3.659e-01, -2.529e00, -5.387e-01, -9.730e-01, 1.106e00, ..., 2.867e-01,-2.998e-01, 1.395e00, 1.922e-01, -2.857e00],[-1.248e00, 9.511e-02, 1.104e00, -2.893e-01, 2.386e-01, ..., -4.030e-01,-1.431e00, 1.698e00, 7.792e-02, 5.647e-01],[-8.082e-01, -1.269e00, -9.518e-01, -1.230e00, 1.623e-01, ..., 6.505e-01,1.299e-01, -2.172e00, 9.718e-01, 1.547e-01],[ 3.541e-01, -1.212e00, 1.333e00, -8.269e-01, 3.842e-01, ..., -2.083e-01,2.715e00, 1.210e00, -1.783e00, -7.736e-01],...,[ 3.425e-02, -6.938e-01, 6.390e-02, -1.265e00, 3.217e-01, ..., 1.713e00,5.801e-01, 1.101e00, -1.443e00, -2.739e-01],[ 8.133e-01, -1.418e00, -6.581e-01, 2.327e00, 1.146e00, ..., 6.545e-01,-7.152e-01, -6.270e-01, -9.436e-01, -1.858e00],[ 1.339e00, 6.877e-02, -1.111e00, 8.770e-01, 1.358e00, ..., -2.793e00,-1.135e-01, 1.498e00, 6.292e-01, 1.196e00],[-1.095e-01, 6.439e-01, -7.375e-01, 4.185e-01, -1.045e-01, ..., -1.521e00,6.631e-01, 2.701e-01, 1.107e-01, -1.860e-01],[-1.281e00, 3.997e-01, 1.881e-03, 1.170e00, 4.183e-01, ..., 3.738e-01,5.330e-01, -2.445e-01, 7.956e-01, -7.097e-01]], devicecuda:0)示例 2设置打印的精度 import torch# 创建一个包含小数的张量 tensor torch.tensor([1.123456789, 2.987654321])# 设置打印选项限制打印的浮点数精度为3位小数 torch.set_printoptions(precision3)# 打印张量 print(tensor) output tensor([1.123, 2.988], devicecuda:0)示例 3设置科学记数法的阈值 import torch# 创建一个包含大数和小子数的张量 tensor torch.tensor([1e-5, 1e5])# 设置打印选项当绝对值小于1e-3时使用科学记数法 torch.set_printoptions(sci_modeTrue, threshold1e3)# 打印张量 print(tensor) output tensor([1.000e-05, 1.000e05], devicecuda:0)示例 4设置张量的边距 import torch# 创建一个张量 tensor torch.randn(5, 5)# 设置打印选项行字符宽度 torch.set_printoptions(edgeitems3, linewidth40) # 打印张量 print(tensor)# 设置打印选项行字符宽度 torch.set_printoptions(edgeitems3, linewidth50) # 打印张量 print(tensor) output tensor([[-0.787, 0.227, -1.878, 0.286,-0.899],[ 0.483, 1.054, 0.770, -0.245,1.599],[ 0.165, -0.034, 1.457, -0.944,0.601],[-0.150, 0.388, -0.811, -0.741,1.286],[-0.657, -0.895, 0.680, 0.946,-1.832]], devicecuda:0) tensor([[-0.787, 0.227, -1.878, 0.286, -0.899],[ 0.483, 1.054, 0.770, -0.245, 1.599],[ 0.165, -0.034, 1.457, -0.944, 0.601],[-0.150, 0.388, -0.811, -0.741, 1.286],[-0.657, -0.895, 0.680, 0.946, -1.832]],devicecuda:0)示例 5恢复默认打印选项 import torch# 创建一个张量 tensor torch.randn(5, 5)# 恢复默认打印选项 torch.set_printoptions(profiledefault) # 打印张量 print(tensor)# 设置打印选项为short torch.set_printoptions(profileshort) # 打印张量 print(tensor)# 设置打印选项为full torch.set_printoptions(profilefull) # 打印张量 print(tensor) output tensor([[-0.4571, 0.3753, -1.5940, -0.7643, -2.1443],[ 0.6022, -0.7247, -0.0522, 1.3891, 0.5575],[ 0.6133, -0.4906, 0.8597, -0.7087, 2.1163],[-0.0721, 0.7349, 1.2677, 0.8921, -0.2049],[ 0.3666, 0.1874, 1.7164, 1.0258, -1.8709]], devicecuda:0) tensor([[-0.46, 0.38, -1.59, -0.76, -2.14],[ 0.60, -0.72, -0.05, 1.39, 0.56],[ 0.61, -0.49, 0.86, -0.71, 2.12],[-0.07, 0.73, 1.27, 0.89, -0.20],[ 0.37, 0.19, 1.72, 1.03, -1.87]], devicecuda:0) tensor([[-0.4571, 0.3753, -1.5940, -0.7643, -2.1443],[ 0.6022, -0.7247, -0.0522, 1.3891, 0.5575],[ 0.6133, -0.4906, 0.8597, -0.7087, 2.1163],[-0.0721, 0.7349, 1.2677, 0.8921, -0.2049],[ 0.3666, 0.1874, 1.7164, 1.0258, -1.8709]], devicecuda:0)
http://www.hkea.cn/news/14531690/

相关文章:

  • 如何做好网站关键词优化云南建设银行官方网站
  • 彩票网站建设开发做爰片在线看网站
  • 摄影网站建设公司免费咨询新冠医生
  • 对亚马逊网站做简要分析与评价asp.net怎么做登录网站
  • 哪个网站做图找图片淘宝店铺首页设计
  • 网站原型是产品经理做wordpress替换图片不显示
  • 网站建设开发报价昆明网站设计制造
  • 一般网站的架构个人网页制作成品下载
  • 优质企业网站开发广告平面设计好学吗
  • 宁波外贸公司网站建设受欢迎的做pc端网站
  • 网站建设关于网上书店图片素材企业展厅设计图
  • 网站建设四个步骤怎么才能让自己做的网站上传到百度搜关键字可以搜到
  • 有没有公司直招的网站郑州抖音seo推广
  • 班级网站设计wordpress网站的弹窗怎么做
  • 手机微信客户端网站建设自己做网站切入地图
  • 自动生成网页代码的软件抖音seo运营模式
  • 有没有专业做二维码连接网站在dw网页素材
  • 海南的网站建设公司哪家好中装建设官网
  • 农家乐网站 建设天塔网站建设公司
  • 百度云建站WordPress职业学院网站建设方案
  • 邳州哪家做百度推广网站如何在国外建设网站
  • 西安做百度网站的找app开发公司
  • 企业网站建设公和布克赛尔网站建设
  • 有口碑的常州网站优化网页制作平台有什么
  • 网站开发设计有限公司郑州软件公司排行榜
  • 轴承网站建设济南网站建设行知科技
  • 网站关键词搜索排名减少WordPress跳转
  • 市通建设工程质量监督局网站免费公司企业建站代理
  • 模板网站是啥意思做网站推广话术
  • 网站建设推广刘贺稳1公司网站网络营销是什么