分類目錄:《深入淺出Pytorch函數(shù)》總目錄
相關文章:
· 深入淺出Pytorch函數(shù)——torch.max
· 深入淺出Pytorch函數(shù)——torch.maximum文章來源:http://www.zghlxwxcb.cn/news/detail-607487.html
計算input
和other
的元素最大值。文章來源地址http://www.zghlxwxcb.cn/news/detail-607487.html
語法
torch.maximum(input, other, *, out=None) -> Tensor
參數(shù)
-
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]])
到了這里,關于深入淺出Pytorch函數(shù)——torch.maximum的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!