深入浅出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]])
相关推荐
不加辣椒2 分钟前
第 4 章 什么是 Harness Engineering
人工智能
桃西西呀2 分钟前
上下文窗口都卷到 100 万了,大模型为什么还在为"位置"发愁?
人工智能·llm·ai编程
黄油面包21 分钟前
Codex 额度三天见底后,我重新做了一周预算
前端·人工智能
AI效率君26 分钟前
Deer‑Flow 2.0 + Go‑MCP‑Server(add加法工具)保姆级完整教程
人工智能·agent
阿拉斯攀登27 分钟前
SpringCloud微服务MQTT架构:设备消息统一接入、业务分发设计
人工智能
Csvn1 小时前
第 12 章 并行化 Parallelization
人工智能·aigc·agent
大刚测试开发实战1 小时前
我在WorkBuddy上打通了TestHub,全程用AI来跑测试!
人工智能
IT_陈寒1 小时前
为什么我的Vue组件总是莫名其妙重渲染?
前端·人工智能·后端
欧特克_Glodon2 小时前
OpenCV计算机视觉开发入门与实践<二十七>:图像分割概述
c++·人工智能·opencv·计算机视觉