torch.sym_max¶ torch.sym_max(a, b)[source][source]¶ 用於計算最大值的 SymInt 感知工具,它避免了對 a < b 進行分支判斷。與內建的 builtins.max() 不同,它僅適用於 int/float 型別,並且如果任一引數是 float,則總是提升為 float 型別(與 builtins.max 不同,builtins.max 會忠實地保留輸入引數的型別)。