code: def _greedy_sample(
      selected_seq_groups: List[Tuple[List[int], SamplingParams]],
      logprobs: torch.Tensor,
  ) -> List[Tuple[List[int], List[int]]]:
      samples = torch.argmax(logprobs, dim=-1).cpu()
      sample_idx = 0
      results = []
      for seq_group in selected_seq_groups:
          seq_ids, _ = seq_group
          num_parent_seqs = len(seq_ids)
          parent_ids = list(range(num_parent_seqs))
          next_token_ids = [samples[sample_idx].item()]
          results.append((next_token_ids, parent_ids))
          sample_idx += num_parent_seqs
      return results
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from bigdl.llm.vllm.model_executor.input_metadata import InputMetadata
  from bigdl.llm.vllm.sampling_params import SamplingParams, SamplingType
  from bigdl.llm.vllm.sequence import SamplerOutput, SequenceGroupMetadata, SequenceData, SequenceOutputs
  import time
label_desc: Use image node_id 10 for calling a global function with example usage: _greedy_sample(selected_seq_groups, logprobs) and returns: results