This action will force synchronization from OpenDocCN/pytorch-doc-zh, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
译者:冯宝宝
可以通过torch.finfo
或 torch.iinfo
访问torch.dtype
的数字属性。
class torch.finfo
torch.finfo
是一个用来表示浮点torch.dtype
的数字属性的对象(即torch.float32
,torch.float64
和torch.float16
)。 这类似于 numpy.finfo。
torch.finfo
提供以下属性:
名称 | 类型 | 描述 |
---|---|---|
bits | 整型 int | 数据类型占用的位数 |
eps | 浮点型float | 可表示的最小数字,使得1.0 + eps!= 1.0 |
max | 浮点型float | 可表示的最大数字 |
tiny | 浮点型float | 可表示的最小正数 |
注意
在使用pytorch默认dtype创建类(由torch.get_default_dtype()
返回)的情况下,构造的 torch.finfo
函数可以不带参数被调用。
class torch.iinfo
torch.iinfo
是一个用来表示整数torch.dtype
的数字属性的对象,(即torch.uint8
,torch.int8
,torch.int16
,torch.int32
和torch.int64
)。 这与numpy.iinfo类似。
torch.iinfo
提供以下属性:
名称 | 类型 | 描述 |
---|---|---|
bits | 整型 | 数据类型占用的位数 |
max | 整型 | 可表示的最大数字 |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。