cannot import name 'Def' from 'torch._C'
时间: 2023-10-11 15:04:53 浏览: 112
浅谈pytorch中torch.max和F.softmax函数的维度解释
5星 · 资源好评率100%
This error message typically occurs when you try to import a module or function that does not exist in the `torch._C` module.
Here are a few things you can try to resolve this issue:
1. Check for typos in your import statement. Make sure that you have spelled the module or function name correctly.
2. Check the version of PyTorch you are using. The `Def` module may not be available in older versions of PyTorch. Try upgrading to the latest version.
3. Check the documentation for the module or function you are trying to import. It's possible that the module or function has been deprecated or removed.
4. Try importing the module or function from a different module in PyTorch. For example, instead of importing `Def` from `torch._C`, try importing it from `torch`.
阅读全文