code: def get_range_vector(size, device):
      """
      Returns a range vector with the desired size, starting at 0. The CUDA implementation
      is meant to avoid copy data from CPU to GPU.
      """
      if device > -1:
          return (
              torch.cuda.LongTensor(size, device=device)
              .fill_(1)
              .cumsum(0)
              - 1
          )
      else:
          return torch.arange(0, size, dtype=torch.long)
  
imports: from __future__ import division
  from __future__ import absolute_import
  from collections import defaultdict
  import logging
  import math
  import torch
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 29 for calling a global function with example usage: get_range_vector(size, device) and returns: unknown, torch