diff --git a/ebtorch/__init__.py b/ebtorch/__init__.py index 683b9e7..c96c52e 100644 --- a/ebtorch/__init__.py +++ b/ebtorch/__init__.py @@ -92,6 +92,7 @@ del SolvePoissonTensor del SwiGLU del TupleDecouple +del TupleSelect del SilhouetteScore del Concatenate del DuplexLinearNeck diff --git a/ebtorch/nn/__init__.py b/ebtorch/nn/__init__.py index eda87c1..f09f340 100644 --- a/ebtorch/nn/__init__.py +++ b/ebtorch/nn/__init__.py @@ -40,6 +40,7 @@ from .architectures import SirenSine from .architectures import SwiGLU from .architectures import TupleDecouple +from .architectures import TupleSelect from .architectures_resnets_dm import PreActResNet from .architectures_resnets_dm import WideResNet from .convolutional_flatten import ConvolutionalFlattenLayer diff --git a/ebtorch/nn/architectures.py b/ebtorch/nn/architectures.py index fe94403..8c29df2 100644 --- a/ebtorch/nn/architectures.py +++ b/ebtorch/nn/architectures.py @@ -60,6 +60,7 @@ "Clamp", "SwiGLU", "TupleDecouple", + "TupleSelect", "SilhouetteScore", "Concatenate", "DuplexLinearNeck", @@ -907,6 +908,15 @@ def forward(self, xtuple: Tuple[Tensor, ...]) -> Tuple[Tensor, ...]: ) +class TupleSelect(nn.Module): + def __init__(self, idx: int = 0) -> None: + super().__init__() + self.idx: int = idx + + def forward(self, xtuple: Tuple[Tensor, ...]) -> Tensor: + return xtuple[self.idx] + + class SilhouetteScore(nn.Module): """ Layerized computation of the Silhouette Score. diff --git a/setup.py b/setup.py index f9a47b7..77e2a66 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def read(fname): setup( name=PACKAGENAME, - version="0.25.11", + version="0.25.12", author="Emanuele Ballarin", author_email="emanuele@ballarin.cc", url="https://github.com/emaballarin/ebtorch",