code: def t5_position_ids(token_ids: Tensor) -> Tensor:
      """Calculate position ids from token ids
      Args:
          token_ids (Tensor): input tokens
  
      Returns:
          Tensor: position ids
      """
      seq_length = token_ids.size(1)
      position_ids = torch.arange(
          seq_length, dtype=torch.long, device=token_ids.device
      )
      position_ids = position_ids.unsqueeze(0).expand_as(token_ids)
  
      return position_ids
  
imports: import logging
  from typing import List, Literal, Optional
  import torch
  from torch import Tensor
  from megatron.core import InferenceParams, parallel_state, tensor_parallel
  from megatron.core.models.common.embeddings.language_model_embedding import LanguageModelEmbedding
  from megatron.core.models.common.embeddings.rotary_pos_embedding import RotaryEmbedding
  from megatron.core.models.common.language_module.language_module import LanguageModule
  from megatron.core.transformer.enums import AttnMaskType, ModelType
  from megatron.core.transformer.module import MegatronModule
  from megatron.core.transformer.spec_utils import ModuleSpec
  from megatron.core.transformer.transformer_block import TransformerBlock
  from megatron.core.transformer.transformer_config import TransformerConfig
  from megatron.core.utils import make_tp_sharded_tensor_for_checkpoint
label_desc: Use image node_id 2 for calling a global function with example usage: t5_position_ids(token_ids) and returns: position_ids