'Importing a library in one file and using it in another file, without importing
There is a file named transforms.py, in it torchvision.transforms is imported and some custom transformations are defined. In another file named main.py, transforms.py is imported.
Now, in order to use torchvision.transforms.Normalize in main.py without importing it, Will it work (Normalize is not used in transforms.py, only imported)? And if it works, what's the reason behind it?
transforms.py:
from torchvision.transforms import *
...
Custom transformations defined
...
main.py
from data import transforms
...
normalize = transforms.Normalize(mean=[0.5,0.5,0.5],std=[0.1,0.1,0.1])
...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
