8

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?

MrBean Bremen
  • 14,916
  • 3
  • 26
  • 46
Tejas
  • 123
  • 1
  • 7

0 Answers0