def pin_memory_(self):
        """Copy `FusedCSCSamplingGraph` to the pinned memory in-place. Returns
        the same object modified in-place."""
        if is_wsl():
            gb_warning(
                "In place pinning is not supported on WSL. "
                "Returning the out of place pinned `FusedCSCSamplingGraph`."
            )
            return self.to("pinned")
        # torch.Tensor.pin_memory() is not an inplace operation. To make it
        # truly in-place, we need to use cudaHostRegister. Then, we need to use
        # cudaHostUnregister to unpin the tensor in the destructor.
        # https://github.com/pytorch/pytorch/issues/32167#issuecomment-753551842
        cudart = torch.cuda.cudart()
        if not hasattr(self, "_is_inplace_pinned"):
            self._is_inplace_pinned = set()

        def _pin(x):
            if hasattr(x, "pin_memory_"):
                x.pin_memory_()
            elif (
                isinstance(x, torch.Tensor)
                and not x.is_pinned()
                and x.device.type == "cpu"
            ):
                assert (
                    x.is_contiguous()
                ), "Tensor pinning is only supported for contiguous tensors."
                assert (
                    cudart.cudaHostRegister(
                        x.data_ptr(), x.numel() * x.element_size(), 0
                    )
                    == 0
                )

                self._is_inplace_pinned.add(x)
                self._inplace_unpinner = cudart.cudaHostUnregister

            return x

        return self._apply_to_members(_pin)
Copy `FusedCSCSamplingGraph` to the pinned memory in-place. Returns
        the same object modified in-place.
python/dgl/graphbolt/impl/fused_csc_sampling_graph.py