code: def batch_num(nums):
      lengths = torch.tensor([len(n) for n in nums]).long()
      n = lengths.max()
      out = torch.zeros(len(nums), n).long()
      for b, n in enumerate(nums):
          out[b, : len(n)] = torch.tensor(n)
      return out, lengths
  
file_path: pytorch-struct/examples/bert-dep.py
imports: import torchtext
  import torch
  from torch import nn
  from torch_struct import DependencyCRF
  from torch_struct.data import SubTokenizedField, ConllXDataset, TokenBucket
  from torchtext.data import RawField, BucketIterator
  from pytorch_transformers import BertModel, BertTokenizer, AdamW, WarmupLinearSchedule
label_desc: Use image node_id 1 for calling a global function with example usage: batch_num(nums) and returns: out,  lengths