torch.mm

python 复制代码
torch.mm(input, mat2, *, out=None) → Tensor

执行矩阵input和mat2的矩阵乘法运算。

如果input是(n×m)张量,mat2是(m×p)张量,out将是(n x p)张量。

input(张量)--第一个要矩阵相乘的矩阵

mat2(张量)--第二个要矩阵相乘的矩阵

out(张量,可选)--输出张量。

python 复制代码
>>> mat1 = torch.randn(2, 3)
>>> mat2 = torch.randn(3, 3)
>>> torch.mm(mat1, mat2)
tensor([[ 0.4851,  0.5037, -0.3633],
        [-0.0760, -3.6705,  2.4784]])
相关推荐
山土成旧客几秒前
【Python学习打卡-Day35】从黑盒到“玻璃盒”:掌握PyTorch模型可视化、进度条与推理
pytorch·python·学习
DeepVis Research3 分钟前
【BCI/Consensus】2026年度脑机接口协同与分布式共识机制基准索引 (Benchmark Index)
人工智能·网络安全·数据集·脑机接口·分布式系统
cyyt3 分钟前
深度学习周报(25.12.29~26.1.4)
人工智能·深度学习
自不量力的A同学5 分钟前
Resemble AI 发布开源语音合成模型 Chatterbox Turbo
人工智能
Master_oid6 分钟前
机器学习28:增强式学习(Deep Reinforcement Learn)③
人工智能·学习·机器学习
PS1232328 分钟前
港口机械安全运行 风速监测技术守护物流畅通
人工智能
万俟淋曦9 分钟前
【论文速递】2025年第51周(Dec-14-20)(Robotics/Embodied AI/LLM)
人工智能·深度学习·机器人·大模型·论文·robotics·具身智能
汗流浃背了吧,老弟!10 分钟前
基于 BERT 的指令微调
人工智能·深度学习·bert
Jerryhut13 分钟前
Opencv总结8——停车场项目实战
人工智能·opencv·计算机视觉
WWZZ202514 分钟前
SLAM进阶——数据集
人工智能·计算机视觉·机器人·大模型·slam·具身智能