pooling_params.py 600 B

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