深入浅出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]])
相关推荐
Gary jie7 小时前
AI上下文管理与记忆架构详解
人工智能·机器学习·架构·openclaw
大树887 小时前
【无标题】
大数据·运维·服务器·人工智能
我材不敲代码7 小时前
基于dlib+OpenCV的人脸疲劳检测 + 年龄性别识别实战
人工智能·opencv·计算机视觉
victory04317 小时前
2026年4月7日nanoGPT训练记录
人工智能
bst@微胖子7 小时前
PyTorch深度学习框架之多分类交叉熵实现图像分类
pytorch·深度学习·分类
人工智能AI技术7 小时前
AI Agent 的 Harness 机制学习思考
人工智能
夜郎king7 小时前
基于 QGIS 的经销网点空间制图:张雪机车全国门店可视化案例
人工智能·qgis·空间可视化·张雪机车·经销网点制图
chools8 小时前
Java后端拥抱AI开发之个人学习路线 - - Spring AI【第四期】(Tool + MCP)
java·人工智能·学习·spring
薛定猫AI8 小时前
【深度解析】Hermes Agent:用“提示反向传播”打造可自我进化的 AI 智能体
人工智能
亦暖筑序8 小时前
多轮对话的记忆心脏:ChatMemory 滑动窗口原理
java·人工智能