本文簡要介紹python語言中 torch.cummax
的用法。
用法:
torch.cummax(input, dim, *, out=None)
返回一個命名元組
(values, indices)
其中values
是維度dim
中input
的元素的累積最大值。並且indices
是在維度dim
中找到的每個最大值的索引位置。例子:
>>> a = torch.randn(10) >>> a tensor([-0.3449, -1.5447, 0.0685, -1.5104, -1.1706, 0.2259, 1.4696, -1.3284, 1.9946, -0.8209]) >>> torch.cummax(a, dim=0) torch.return_types.cummax( values=tensor([-0.3449, -0.3449, 0.0685, 0.0685, 0.0685, 0.2259, 1.4696, 1.4696, 1.9946, 1.9946]), indices=tensor([0, 0, 2, 2, 2, 5, 6, 6, 8, 8]))
相關用法
- Python PyTorch cummin用法及代碼示例
- Python PyTorch cumprod用法及代碼示例
- Python PyTorch cumsum用法及代碼示例
- Python PyTorch cumulative_trapezoid用法及代碼示例
- Python PyTorch custom_from_mask用法及代碼示例
- Python PyTorch custom_replace用法及代碼示例
- Python PyTorch cholesky用法及代碼示例
- Python PyTorch column_stack用法及代碼示例
- Python PyTorch calculate_gain用法及代碼示例
- Python PyTorch cov用法及代碼示例
- Python PyTorch cos用法及代碼示例
- Python PyTorch compute_deltas用法及代碼示例
- Python PyTorch conv_transpose3d用法及代碼示例
- Python PyTorch combinations用法及代碼示例
- Python PyTorch conv2d用法及代碼示例
- Python PyTorch collect_all用法及代碼示例
- Python PyTorch chunk用法及代碼示例
- Python PyTorch convert用法及代碼示例
- Python PyTorch conv1d用法及代碼示例
- Python PyTorch chain_matmul用法及代碼示例
- Python PyTorch cat用法及代碼示例
- Python PyTorch constant_用法及代碼示例
- Python PyTorch context用法及代碼示例
- Python PyTorch count_nonzero用法及代碼示例
- Python PyTorch cdist用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.cummax。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。