def _detach_tensor_to_cpu(
        self, output_image: Union[Tensor, list[Tensor], tuple[Tensor]]
    ) -> Union[Tensor, list[Tensor], tuple[Tensor]]:
        """Detach the input tensor (or list/tuple of tensors) from the GPU and move it to the CPU.

        Args:
            output_image (Union[Tensor, list[Tensor], tuple[Tensor]]): The input tensor(s) to be moved.

        Returns:
            Union[Tensor, list[Tensor], tuple[Tensor]]: The tensor(s) moved to the CPU and detached from
            the computational graph.
        """
        if isinstance(output_image, (Tensor,)):
            return output_image.detach().cpu()
        if isinstance(
            output_image,
            (
                list,
                tuple,
            ),
        ):
            return type(output_image)([self._detach_tensor_to_cpu(out) for out in output_image])  # type: ignore
        raise RuntimeError(f"Unexpected object {output_image} with a type of `{type(output_image)}`")
Detach the input tensor (or list/tuple of tensors) from the GPU and move it to the CPU.

        Args:
            output_image (Union[Tensor, list[Tensor], tuple[Tensor]]): The input tensor(s) to be moved.

        Returns:
            Union[Tensor, list[Tensor], tuple[Tensor]]: The tensor(s) moved to the CPU and detached from
            the computational graph.
        
kornia/core/module.py