deadleaves.utils ================ .. py:module:: deadleaves.utils Functions --------- .. autoapisummary:: deadleaves.utils.choose_compute_backend deadleaves.utils.bounding_box Module Contents --------------- .. py:function:: choose_compute_backend() -> torch.device This function will automatically assign the available compute backend Returns: torch.device: A suitable PyTorch compute backend. .. py:function:: bounding_box(partition: torch.Tensor, leaf_idx: int) -> tuple[int, int, int, int] Generate boundaries for bounding box for leaf index in partition Args: partition (torch.Tensor): Partition to use for bounding box leaf_idx (int): Index of relevant leaf Returns: tuple[int, int, int, int] | None: Top, left, bottom, right boundary indices of bounding box.