Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ from typing import Mapping, Sequence, Union
from collatable import LabelField, TextField
from collatable.extras import DataLoader, Dataset, DefaultBatchSampler, LabelIndexer, TokenIndexer
from collatable.extras.datamodule import DataModule, LabelFieldTransform, TextFieldTransform
from collatable.util import debatched
from collatable.utils import debatched


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion collatable/collator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Dict, Mapping, Optional, Sequence, Set

from collatable.fields import Field
from collatable.typing import DataArray, INamedTuple
from collatable.types import DataArray, INamedTuple


class Collator:
Expand Down
2 changes: 1 addition & 1 deletion collatable/extras/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from collatable.collator import Collator
from collatable.fields import Field
from collatable.typing import DataArray
from collatable.types import DataArray

T = TypeVar("T")
T_co = TypeVar("T_co", covariant=True)
Expand Down
2 changes: 1 addition & 1 deletion collatable/extras/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)

from collatable import Field, LabelField, TextField
from collatable.typing import DataArray, IntTensor, Scalar, Tensor
from collatable.types import DataArray, IntTensor, Scalar, Tensor

S = TypeVar("S")
T = TypeVar("T")
Expand Down
2 changes: 1 addition & 1 deletion collatable/extras/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import numpy

from collatable.typing import Tensor
from collatable.types import Tensor

ValueT = TypeVar("ValueT", bound=Hashable)
Self = TypeVar("Self", bound="Indexer")
Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/adjacency_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from collatable.fields.field import Field, PaddingValue
from collatable.fields.sequence_field import SequenceField
from collatable.typing import IntTensor
from collatable.types import IntTensor

Self = TypeVar("Self", bound="AdjacencyField")
LabelT = TypeVar("LabelT", bound=Hashable)
Expand Down
4 changes: 2 additions & 2 deletions collatable/fields/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import numpy

from collatable.typing import ArrayLike, DataArrayT
from collatable.util import stack_with_padding
from collatable.types import ArrayLike, DataArrayT
from collatable.utils import stack_with_padding

Self = TypeVar("Self", bound="Field")
PaddingValue = Union[Dict[str, ArrayLike], ArrayLike]
Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/index_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collatable.fields.field import Field
from collatable.fields.sequence_field import SequenceField
from collatable.typing import IntTensor
from collatable.types import IntTensor


class IndexField(Field[IntTensor]):
Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/label_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy

from collatable.fields.field import Field
from collatable.typing import IntTensor
from collatable.types import IntTensor

Self = TypeVar("Self", bound="LabelField")
LabelT = TypeVar("LabelT", bound=Hashable)
Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/list_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collatable.fields.field import Field, PaddingValue
from collatable.fields.sequence_field import SequenceField
from collatable.typing import DataArrayT
from collatable.types import DataArrayT


class ListField(Generic[DataArrayT], SequenceField[DataArrayT]):
Expand Down
4 changes: 2 additions & 2 deletions collatable/fields/scalar_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import numpy

from collatable.fields.field import Field
from collatable.typing import ScalarT, Tensor
from collatable.util import get_scalar_default_value
from collatable.types import ScalarT, Tensor
from collatable.utils import get_scalar_default_value


class ScalarField(Field[Tensor]):
Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/sequence_field.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Generic, TypeVar

from collatable.fields.field import Field
from collatable.typing import DataArrayT
from collatable.types import DataArrayT

Self = TypeVar("Self", bound="SequenceField")

Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/sequence_label_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from collatable.fields.field import PaddingValue
from collatable.fields.sequence_field import SequenceField
from collatable.typing import IntTensor
from collatable.types import IntTensor

LabelT = TypeVar("LabelT", bound=Hashable)

Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/span_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collatable.fields.field import Field, PaddingValue
from collatable.fields.sequence_field import SequenceField
from collatable.typing import IntTensor
from collatable.types import IntTensor


class SpanField(Field[IntTensor]):
Expand Down
2 changes: 1 addition & 1 deletion collatable/fields/tensor_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy

from collatable.fields.field import Field
from collatable.typing import ArrayLike, TensorT
from collatable.types import ArrayLike, TensorT


class TensorField(Generic[TensorT], Field[TensorT]):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion collatable/util.py → collatable/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy

from collatable.typing import ArrayLike, DataArray, ScalarT, TensorT
from collatable.types import ArrayLike, DataArray, ScalarT, TensorT


def stack_with_padding(
Expand Down