code: def _to_kjt(
      seqs: torch.LongTensor, device: torch.device
  ) -> KeyedJaggedTensor:
      seqs_list = list(seqs)
      lengths = torch.IntTensor([value.size(0) for value in seqs_list])
      values = torch.cat(seqs_list, dim=0)
  
      kjt = KeyedJaggedTensor.from_lengths_sync(
          keys=["item"], values=values, lengths=lengths
      ).to(device)
      return kjt
  
imports: import argparse
  import os
  import sys
  from typing import Any, cast, Dict, List, Union
  import numpy
  import torch
  import torch.nn
  import torch.optim
  import torch.utils.data
  from fbgemm_gpu.split_embedding_configs import EmbOptimType
  from torch import distributed
  from torch.nn.parallel import DistributedDataParallel
  from torchrec.distributed.embedding import EmbeddingCollectionSharder
  from torchrec.distributed.model_parallel import DistributedModelParallel
  from torchrec.distributed.types import ModuleSharder
  from torchrec.optim.keyed import CombinedOptimizer, KeyedOptimizerWrapper
  from torchrec.optim.optimizers import in_backward_optimizer_filter
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: _to_kjt(seqs, device) and returns: kjt