深入浅出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]])
相关推荐
用户82997929439339 分钟前
一文带你彻底搞懂claude code中的上下文压缩
人工智能
IT_陈寒1 小时前
Vue的这个响应式陷阱让我熬到凌晨三点
前端·人工智能·后端
冬奇Lab10 小时前
Workflow 系列(01):基础理论——三种执行模型与 Anthropic 5 种模式
人工智能·agent·工作流引擎
冬奇Lab11 小时前
每日一个开源项目(第143篇):page-agent - 纯 JS 的网页 GUI Agent,无需截图、无需插件、无需后端
前端·人工智能·agent
程序员cxuan13 小时前
虽迟但到!GPT-5.6 终于来了!
人工智能·后端·程序员
ZhengEnCi15 小时前
Q03-UI设计进阶技巧-让界面更高级的7个核心原则
人工智能
IT_陈寒15 小时前
React的这个渲染问题连官方文档都没说清楚
前端·人工智能·后端
不加辣椒16 小时前
第12章 工具调用与 Agent 提示工程
人工智能
用户16931761726616 小时前
前端给AI消息做日期分组与时间线
人工智能
i晟16 小时前
Claude Code Harness 深度拆解:从你敲回车到模型回复,中间发生了什么
人工智能