本文簡要介紹python語言中 torch.amin
的用法。
用法:
torch.amin(input, dim, keepdim=False, *, out=None) → Tensor
out(Tensor,可選的) -輸出張量。
返回給定維度
dim
中input
張量的每個切片的最小值。注意
max
/min
和amax
/amin
之間的區別是:amax
/amin
支持多維縮減,amax
/amin
不返回索引,amax
/amin
在相等的值之間均勻分布梯度,而max(dim)
/min(dim)
僅將梯度傳播到源張量中的單個索引。
如果
keepdim
是True
,則輸出張量的大小與input
相同,但在維度dim
中它的大小為 1。否則,dim
被壓縮(參見torch.squeeze()
),導致輸出張量的維度少 1 個(或len(dim)
)。例子:
>>> a = torch.randn(4, 4) >>> a tensor([[ 0.6451, -0.4866, 0.2987, -1.3312], [-0.5744, 1.2980, 1.8397, -0.2713], [ 0.9128, 0.9214, -1.7268, -0.2995], [ 0.9023, 0.4853, 0.9075, -1.6165]]) >>> torch.amin(a, 1) tensor([-1.3312, -0.5744, -1.7268, -1.6165])
參數:
關鍵字參數:
相關用法
- Python PyTorch aminmax用法及代碼示例
- Python PyTorch amax用法及代碼示例
- Python PyTorch argsort用法及代碼示例
- Python PyTorch addmm用法及代碼示例
- Python PyTorch addmv用法及代碼示例
- Python PyTorch apply_effects_tensor用法及代碼示例
- Python PyTorch assert_close用法及代碼示例
- Python PyTorch angle用法及代碼示例
- Python PyTorch all_reduce用法及代碼示例
- Python PyTorch atanh用法及代碼示例
- Python PyTorch annotate用法及代碼示例
- Python PyTorch async_execution用法及代碼示例
- Python PyTorch argmax用法及代碼示例
- Python PyTorch atan用法及代碼示例
- Python PyTorch as_strided用法及代碼示例
- Python PyTorch acos用法及代碼示例
- Python PyTorch all_gather用法及代碼示例
- Python PyTorch avg_pool1d用法及代碼示例
- Python PyTorch asin用法及代碼示例
- Python PyTorch allreduce_hook用法及代碼示例
- Python PyTorch argmin用法及代碼示例
- Python PyTorch any用法及代碼示例
- Python PyTorch all_to_all用法及代碼示例
- Python PyTorch asinh用法及代碼示例
- Python PyTorch add用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.amin。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。