Is there a difference between following import styles in python?

Viewed 181

I was going through a codebase and noticed the following style of importing modules
import torch.nn as nn

In my personal work, I've always used the followin approach
from torch import nn

Is there any difference between these two styles of importing?

0 Answers
Related