• Emilien Garreau's avatar
    Avoid to keep in memory lengths and bins for ImplicitronRayBundle · 9446d91f
    Emilien Garreau authored
    Summary:
    Convert ImplicitronRayBundle to a "classic" class instead of a dataclass. This change is introduced as a way to preserve the ImplicitronRayBundle interface while allowing two outcomes:
    - init lengths arguments is now a Optional[torch.Tensor] instead of torch.Tensor
    - lengths is now a property which returns a `torch.Tensor`. The lengths property will either recompute lengths from bins or return the stored _lengths. `_lenghts` is None if bins is set. It saves us a bit of memory.
    
    Reviewed By: shapovalov
    
    Differential Revision: D46686094
    
    fbshipit-source-id: 3c75c0947216476ebff542b6f552d311024a679b
    9446d91f
test_models_renderer_base.py 10 KB