The output from a pooling operation in the pooling model.
| 49 | |
| 50 | |
| 51 | class PoolerOutput(msgspec.Struct, omit_defaults=True, array_like=True): |
| 52 | """The output from a pooling operation in the pooling model.""" |
| 53 | |
| 54 | outputs: list[PoolingSequenceGroupOutput] |
| 55 | |
| 56 | def get_data_nbytes(self) -> int: |
| 57 | return sum(o.get_data_nbytes() for o in self.outputs) |
| 58 | |
| 59 | def __getitem__(self, idx: int) -> PoolingSequenceGroupOutput: |
| 60 | return self.outputs[idx] |
| 61 | |
| 62 | def __setitem__(self, idx: int, value: PoolingSequenceGroupOutput): |
| 63 | self.outputs[idx] = value |
| 64 | |
| 65 | def __len__(self): |
| 66 | return len(self.outputs) |
| 67 | |
| 68 | def __eq__(self, other: object): |
| 69 | return isinstance(other, self.__class__) and self.outputs == other.outputs |
no outgoing calls