深入浅出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]])
相关推荐
风象南14 小时前
Token太贵?我用这个数据格式把上下文窗口扩大2倍
人工智能·后端
NAGNIP1 天前
轻松搞懂全连接神经网络结构!
人工智能·算法·面试
moshuying1 天前
别让AI焦虑,偷走你本该有的底气
前端·人工智能
董董灿是个攻城狮1 天前
零基础带你用 AI 搞定命令行
人工智能
喝拿铁写前端1 天前
Dify 构建 FE 工作流:前端团队可复用 AI 工作流实战
前端·人工智能
阿里云大数据AI技术1 天前
阿里云 EMR Serverless Spark + DataWorks 技术实践:引领企业 Data+AI 一体化转型
人工智能
billhan20161 天前
MCP 深入理解:协议原理与自定义开发
人工智能
Jahzo1 天前
openclaw桌面端体验--ClawX
人工智能·github
billhan20161 天前
Agent 开发全流程:从概念到生产
人工智能