[ 组合替代实现 ]torch.Tensor.nbytes

torch.Tensor.nbytes

torch.Tensor.nbytes

Paddle 无此 API,需要组合实现。

转写示例

# PyTorch 写法
y = a.nbytes

# Paddle 写法
y = a.size * a.element_size()