poprox_recommender.pytorch.decorators#
Decorators to help with Torch usage.
Functions
|
Decorator for functions or methods that use PyTorch for inference (an thus |
- poprox_recommender.pytorch.decorators.torch_inference(func)#
Decorator for functions or methods that use PyTorch for inference (an thus
torch.inference_mode()
should be set for performance). It wraps the function in the following logic:with torch.inference_mode(): func()