分类目录:《深入浅出Pytorch函数》总目录
 相关文章:
 · 深入浅出TensorFlow2函数——tf.size
 · 深入浅出Pytorch函数——torch.numel
 · 深入浅出PaddlePaddle函数——paddle.numel
语法
torch.numel(input)
参数
- input: [- torch.Tensor] 输入的张量
返回值
input张量元素的总数
实例
>>> a = torch.randn(1, 2, 3, 4, 5)
>>> torch.numel(a)
120
>>> a = torch.zeros(4,4)
>>> torch.numel(a)
16
本文链接:https://my.lmcjl.com/post/3201.html
展开阅读全文
                                                 
                    
4 评论