深入浅出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]])
相关推荐
火山引擎开发者社区10 小时前
Agent Plan、Coding Plan限时优惠:2.5折畅享多模型!
人工智能
冬奇Lab10 小时前
AI Workflow 定义的四次演进:从 Markdown 到 JS 脚本,再到分布式多 Agent
javascript·人工智能·agent
冬奇Lab10 小时前
每日一个开源项目(第136篇):OpenMemory - 给 AI Agent 真正的认知记忆引擎
人工智能
黄啊码11 小时前
【黄啊码】微信 AI 把聊天功能和 Vibe Coding打通了,创业者:我又白干了
人工智能
IT_陈寒12 小时前
React的useState居然还有这种坑?我差点删库跑路
前端·人工智能·后端
用户4130622582913 小时前
给AI回答加引用角标citation:RAG前端实现
人工智能
米小虾13 小时前
WAIC 2026 倒计时30天:300+ AI 产品全球首发,今年看点全解析
人工智能
码上天下13 小时前
多模态Agent上传图片:前端压缩格式与预览实战
人工智能