Motivation
RandomProjectionHash.__init__ already accepts init_method: Callable[[torch.Tensor], torch.Tensor | None] | None = None and applies it as self.init_method(self.transform) after the projection buffer is materialized. When init_method is None, the constructor falls back to torch.nn.init.normal_.
The class docstring still documents this as init_method: TODO.
Solution
Replace the TODO with a Sphinx Keyword Args: entry that states the type, the default (torch.nn.init.normal_ when None), and that the callable initializes the projection buffer.
Checklist
Motivation
RandomProjectionHash.__init__already acceptsinit_method: Callable[[torch.Tensor], torch.Tensor | None] | None = Noneand applies it asself.init_method(self.transform)after the projection buffer is materialized. Wheninit_methodisNone, the constructor falls back totorch.nn.init.normal_.The class docstring still documents this as
init_method: TODO.Solution
Replace the TODO with a Sphinx
Keyword Args:entry that states the type, the default (torch.nn.init.normal_whenNone), and that the callable initializes the projection buffer.Checklist