__all__ += [name for name in dir(_C) NameError: name '_C' is not defined pytorch

I’m making an application where I use torch, but when I run the file importing torch it always gives this error:

all += [name for name in dir(_C)
NameError: name ‘_C’ is not defined

does anyone know how to solve?

what i know _C is a folder inside of torch folder

I’m not such which methods you are looking for but maybe importing torch._C would work for you.

Have you solved your problem?