torch.Tensor.tolist()方法如何使用

发布时间:2021-08-05 17:53:27 作者:Leah
来源:亿速云 阅读:350

这期内容当中小编将会给大家带来有关torch.Tensor.tolist()方法如何使用,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

torch.Tensor.tolist()方法如何使用
原文及翻译:

tolist()方法: tolist()” tolist() -> list or number
    tolist() -> 返回列表或者数字

    Returns the tensor as a (nested) list. For scalars, a standard Python number is returned, just like with item(). Tensors are automatically moved to the CPU first if necessary.This operation is not differentiable.Examples:>>> a = torch.randn(2, 2)>>> a.tolist()[[0.012766935862600803, 0.5415473580360413], [-0.08909505605697632, 0.7729271650314331]]>>> a[0,0].tolist()0.012766935862600803

上述就是小编为大家分享的torch.Tensor.tolist()方法如何使用了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注亿速云行业资讯频道。

推荐阅读:
  1. 数据仓库和Olap的区别是什么
  2. 大数据和云计算有什么关系

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

上一篇:VSCode中怎么连接到IBM Cloud区块链网络

下一篇:如何解决某些HTML字符打不出来的问题

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》