remove unused Chunk and Unbind layers

This commit is contained in:
Pierre Chapuis 2024-01-29 16:32:18 +01:00 committed by Cédric Deltheil
parent c57f2228f8
commit e6be1394ff
2 changed files with 0 additions and 23 deletions

View file

@ -2,7 +2,6 @@ from refiners.fluxion.layers.activations import GLU, ApproximateGeLU, GeLU, ReLU
from refiners.fluxion.layers.attentions import Attention, SelfAttention, SelfAttention2d from refiners.fluxion.layers.attentions import Attention, SelfAttention, SelfAttention2d
from refiners.fluxion.layers.basics import ( from refiners.fluxion.layers.basics import (
Buffer, Buffer,
Chunk,
Cos, Cos,
Flatten, Flatten,
GetArg, GetArg,
@ -15,7 +14,6 @@ from refiners.fluxion.layers.basics import (
Slicing, Slicing,
Squeeze, Squeeze,
Transpose, Transpose,
Unbind,
Unflatten, Unflatten,
Unsqueeze, Unsqueeze,
View, View,
@ -75,9 +73,7 @@ __all__ = [
"Parameter", "Parameter",
"Sin", "Sin",
"Cos", "Cos",
"Chunk",
"Multiply", "Multiply",
"Unbind",
"Matmul", "Matmul",
"Buffer", "Buffer",
"Lambda", "Lambda",

View file

@ -130,25 +130,6 @@ class Unsqueeze(Module):
return x.unsqueeze(self.dim) return x.unsqueeze(self.dim)
class Unbind(Module):
def __init__(self, dim: int = 0) -> None:
self.dim = dim
super().__init__()
def forward(self, x: Tensor) -> tuple[Tensor, ...]:
return x.unbind(dim=self.dim) # type: ignore
class Chunk(Module):
def __init__(self, chunks: int, dim: int = 0) -> None:
self.chunks = chunks
self.dim = dim
super().__init__()
def forward(self, x: Tensor) -> tuple[Tensor, ...]:
return x.chunk(chunks=self.chunks, dim=self.dim) # type: ignore
class Sin(Module): class Sin(Module):
def forward(self, x: Tensor) -> Tensor: def forward(self, x: Tensor) -> Tensor:
return torch.sin(input=x) return torch.sin(input=x)