PyTorch torch.log10 函数

约 215 字 更新于 2026-11-18 5iyo.com

PyTorch torch.log10 函数


torch.log10 是 PyTorch 中用于计算以10为底的对数函数。

函数定义

torch.log10(input, out)

使用示例

实例

import torch

# 计算以10为底的对数
x = torch.tensor([1, 10, 100, 1000])
result = torch.log10(x)
print(result)