2021-03-05 20:39:52 +00:00
|
|
|
import operator
|
|
|
|
|
|
|
|
from pytorch_lightning.utilities.imports import _compare_version
|
|
|
|
|
|
|
|
if _compare_version("torchtext", operator.ge, "0.9.0"):
|
2021-08-02 16:05:56 +00:00
|
|
|
from torchtext.legacy.data import Batch, Dataset, Example, Field, Iterator, LabelField
|
2021-03-05 20:39:52 +00:00
|
|
|
else:
|
|
|
|
from torchtext.data import Batch, Dataset, Example, Field, Iterator, LabelField # noqa: F401
|