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

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

相关文章:

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

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


计算input和other的元素最大值。

语法

复制代码
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 小时前
Chrome 内存泄漏诊断指南
人工智能
Mirawork8 小时前
AI 低代码建站原理:从自然语言需求到在线应用,拆解 AI 生成网页的完整技术链路
人工智能·低代码·ai·ai编程
xsd202411188 小时前
rea-video开源 AI 视频逆向工具
人工智能
thinking_talk9 小时前
AI 自动诊断慢 SQL 怎么落地:五层能力怎么分,以及生产可用要过哪几道门槛
数据库·人工智能·sql·慢sql
程序猿追9 小时前
HarmonyOS 7 ArkUI 卡片点击分发:点关闭按钮,怎样确保只收起推荐
pytorch·深度学习·harmonyos
码上观世界9 小时前
IndexTTS接入实时交互数字人系统实践
人工智能·实时互动
具身AGI9 小时前
进博会机器人,隔桌对打乒乓球
人工智能·机器人
逐米时代9 小时前
「制造新解法」行业对标方法:借鉴而不照搬的最佳实践
人工智能·算法·制造
小追兵10 小时前
Claude Managed Agents 自托管是什么?企业如何控制 Agent Runtime、Session 与数据?
人工智能
Wellijohn10 小时前
上下文工程实战:把大模型 Agent 从「能跑」做到「上线不掉链子」
人工智能·llm·agent