Shortcuts

torch.Tensor.nbytes

Tensor.nbytes

返回张量的元素“视图”所消耗的字节数,如果张量不使用稀疏存储布局。 定义为 numel() * element_size()