gpt4 book ai didi

Pycharm/Pytorch - 'tensor' 不可调用

转载 作者:行者123 更新时间:2023-12-01 16:54:31 25 4
gpt4 key购买 nike

创建 pytorch (1.0) 张量时:

import torch
W = torch.tensor(([1.0]))

Pycharm(2018.3.1)给我以下警告:

'tensor' is not callable less... (Ctrl+F1) 
Inspection info: This inspection highlights attempts to call objects which are not callable, like, for example, tuples

我的代码工作正常(tensor()是可调用的),但我想理解并消除这个警告。

最佳答案

This has been a known issue to them 。版主回复:

We will fix this in the next release. It’s being tracked at https://github.com/pytorch/pytorch/issues/7318

但是,报告的问题是在 PyTorch v0.4.1 上发生的

关于Pycharm/Pytorch - 'tensor' 不可调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53826221/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com