深入浅出Pytorch函数——torch.maximum

分类目录:《深入浅出Pytorch函数》总目录

相关文章:

· 深入浅出Pytorch函数------torch.max

· 深入浅出Pytorch函数------torch.maximum


计算inputother的元素最大值。

语法

复制代码
torch.maximum(input, other, *, out=None) -> Tensor

参数

  • input`Tensor` 输入张量
  • other`Tensor` 输入的第二个张量

实例

复制代码
>>> a = torch.randn(4, 5)
>>> b = torch.randn(4, 5)
>>> torch.max(a, b)
tensor([[ 0.9931,  0.3162,  1.7202,  0.2977,  2.4843],
        [ 2.1384,  0.6760,  0.6328, -1.2002,  0.2046],
        [-0.1132,  0.6711,  2.5104,  1.2836, -1.5387],
        [ 0.4333, -0.1055,  2.3136,  1.2815,  0.3704]])
相关推荐
不加辣椒7 小时前
第15章 上下文窗口管理与长文本策略
人工智能
牛奶8 小时前
AI 能赚钱了——但赚的不是你
人工智能·ai编程·nvidia
凌杰8 小时前
AI 学习笔记:研究方法的演变
人工智能
半盏药香9 小时前
由于jinja2的starlette版本过高引发的问题:500 Server Error TypeError: unhashable type: 'dict'
人工智能
阿里云大数据AI技术9 小时前
MiniMax M3、Kimi K2.7 Code来啦!PAI已支持一键部署,开源前沿触手可及
人工智能·agent
百度Geek说9 小时前
AI Coding 的底层框架:一切优化都是在对抗熵增
人工智能
Java研究者9 小时前
AI智能体研发 | 什么是OpenAI API协议
人工智能·大模型·openai·api·agent·智能体
只是没名字10 小时前
Codex CLI Windows 新手安装教程:从 Node.js 到首次运行
人工智能
用户86306526961310 小时前
Krea 2 LoRA 训练全流程踩坑记录:从打标到双卡并行的 Windows 原生实战
人工智能
木雷坞12 小时前
让 AI 编程助手跑得起项目:Dev Container 实践记录
人工智能