MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / PoolerOutput

Class PoolerOutput

fastdeploy/output/pooler.py:51–69  ·  view source on GitHub ↗

The output from a pooling operation in the pooling model.

Source from the content-addressed store, hash-verified

49
50
51class 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

Callers 10

forwardMethod · 0.90
_poolMethod · 0.90
_poolMethod · 0.90
test_len_and_indexMethod · 0.90
test_setitemMethod · 0.90
test_eq_sameMethod · 0.90
test_eq_diffMethod · 0.90
test_eq_type_mismatchMethod · 0.90

Calls

no outgoing calls

Tested by 7

test_len_and_indexMethod · 0.72
test_setitemMethod · 0.72
test_eq_sameMethod · 0.72
test_eq_diffMethod · 0.72
test_eq_type_mismatchMethod · 0.72