PyTorch torch.min 関数
torch.minは PyTorch でテンソルの最小値を計算するための関数です。
関数定義
torch.min(input, dim, keepdim, out)
使用例
例
import torch
x = torch.tensor([[1, 2, 3], [4, 5, 6]])
print("グローバル最小:", torch.min(x))
print("dim=0 最小:", torch.min(x, dim=0))
x = torch.tensor([[1, 2, 3], [4, 5, 6]])
print("グローバル最小:", torch.min(x))
print("dim=0 最小:", torch.min(x, dim=0))
その他の拡張
Pytorch torch リファレンスマニュアル