code: def compress_ids(ids: torch.Tensor, size: int) -> torch.Tensor:
      return torch._convert_indices_from_coo_to_csr(
          ids, size, out_int32=ids.dtype == torch.int32
      )
  
imports: from typing import Optional, Tuple, Union
  from cugraph.utilities.utils import import_optional
label_desc: Use image node_id 1 for calling a global function with example usage: compress_ids(ids, size) and returns: torch