code: def build_position_ids(token_ids):
      # Create 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).clone()
      )
  
      return position_ids
  
imports: import itertools
  import math
  from typing import Dict, Iterator, List, Tuple, Union
  import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 16 for calling a global function with example usage: build_position_ids(token_ids) and returns: position_ids