当前位置:网站首页>Pytorch view tensor memory size

Pytorch view tensor memory size

2022-07-06 08:49:00 Broken wind boy who keeps his hair

element_size Returns the byte size of a single element ,nelement Number of return elements

import torch

a = torch.zeros([128, 128])
print(a.element_size() * a.nelement())

a = torch.zeros([256, 256])
print(a.element_size() * a.nelement())

原网站

版权声明
本文为[Broken wind boy who keeps his hair]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060846308707.html