pooling_params.py 614 B

1234567891011121314151617181920212223
  1. from typing import Any, Optional
  2. import msgspec
  3. class PoolingParams(
  4. msgspec.Struct,
  5. omit_defaults=True,
  6. array_like=True
  7. ):
  8. """Pooling parameters for pooling.
  9. Attributes:
  10. additional_data: Any additional data needed for pooling.
  11. """
  12. additional_data: Optional[Any] = None
  13. def clone(self) -> "PoolingParams":
  14. """Returns a deep copy of the PoolingParams instance."""
  15. return PoolingParams(additional_data=self.additional_data, )
  16. def __repr__(self) -> str:
  17. return (f"PoolingParams("
  18. f"additional_metadata={self.additional_data})")