首页 > 编程知识 正文

lookup函数使用举例,countif函数使用举例

时间:2023-05-05 09:54:43 阅读:184739 作者:1038

参考链接: torch.numel(input) → int
参考链接: numel() → int

函数使用说明:torch.numel(input) → int返回输入张量input的元素总数 Microsoft Windows [版本 10.0.18363.1256](c) 2019 Microsoft Corporation。保留所有权利。C:Userschenxuqi>conda activate ssd4pytorch1_2_0(ssd4pytorch1_2_0) C:Userschenxuqi>pythonPython 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32Type "help", "copyright", "credits" or "license" for more information.>>> import torch>>> torch.manual_seed(seed=20200910)<torch._C.Generator object at 0x0000021CCA53D330>>>>>>> a = torch.randn(1, 2, 3, 4, 5)>>> a.numel()120>>> torch.numel(a)120>>>>>>>>> a = torch.zeros(4,4)>>> a.numel()16>>>>>>>>> torch.numel(a)16>>>>>>>>>

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。