深入浅出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]])
相关推荐
雨中飘荡的记忆4 分钟前
Claude Code 入门必会:@、!、Slash Commands,一篇讲清楚
人工智能·后端
满眼星河6 分钟前
RAG应用功能边界
人工智能
阿里云大数据AI技术6 分钟前
Hologres Agent:让数仓运维、开发和分析更高效
人工智能·agent
诚小纯9 分钟前
qwen-deep-research 接入实录:两阶段调用、SSE 解析、报告结构与 35 处不可追溯的引用
人工智能·github
RaaS10010 分钟前
Agent Skills 进了 Linux Foundation:2.8 亿次安装,但装 skill 还没有安全规范
人工智能·算法·架构
Hone15 分钟前
一套让 7 个 AI Agent 共享同一份 Skills 的方案(Windows Junction 实战)
人工智能·程序员
烬羽17 分钟前
PostgreSQL:AI 时代原生的"隐型"向量数据库 — 用 pgvector 给消息表加上长期记忆
数据库·人工智能·程序员
snakeshe101017 分钟前
大语言模型常见评估指标与经典模型架构解析
人工智能
用户40158233246221 分钟前
对话一长,AI 就忘了你说过的话?Claude Code、Codex、Aider、WES Code 怎么压缩上下文
人工智能·go·ai编程
用户58333398166822 分钟前
影刀元素点击功能有什么替代方案?含 AI 自愈的几条实测路线
人工智能