class_docstr: Compute the log-likelihood of the input assuming a conditional random field
  model.
  
  Args:
      num_tags: The number of tags
class_docstr_tok: ["Compute","the","log-likelihood","of","the","input","assuming","a","conditional","random","field","model",".","Args",":","num_tags",":","The","number","of","tags"]
code: def _make_mask_from_seq_lens(self, seq_lens):
      seq_lens = seq_lens.view(-1, 1)
      max_len = torch.max(seq_lens)
      range_tensor = torch.arange(
          max_len, device=seq_lens.device
      ).unsqueeze(0)
      range_tensor = range_tensor.expand(
          seq_lens.size(0), range_tensor.size(1)
      )
      mask = (range_tensor < seq_lens).float()
      return mask
  
imports: from typing import List
  import torch
  import torch.jit
  import torch.nn
  from caffe2.python.crf_predict import apply_crf
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 11 for calling the CRF obj's underlying member method code with example usage: obj._make_mask_from_seq_lens(seq_lens) and returns: mask