Python Pylint无法识别torch.cuda子模块

Python Pylint无法识别torch.cuda子模块,python,torch,pylint,Python,Torch,Pylint,我无法发布所有代码,但基本上,mypy无法通过,因为它无法识别amp.autocast()函数并抛出错误 错误:模块没有属性“autocast” 是否可以停用此错误您可以忽略pylint.rc中pylint无法识别的模块和子模块。例如,在numpy上查看此线程 from torch.cuda import amp with amp.autocast(): # some code

我无法发布所有代码,但基本上,
mypy
无法通过,因为它无法识别amp.autocast()函数并抛出错误

错误:模块没有属性“autocast”


是否可以停用此错误

您可以忽略pylint.rc中pylint无法识别的模块和子模块。例如,在numpy上查看此线程
from torch.cuda import amp 
 with amp.autocast():
     # some code