title: regarding one code segment in computing log_sum_exp
body: <p>In this <a href="http://seba1511.net/tutorials/beginner/nlp/advanced_tutorial.html" rel="nofollow noreferrer">tutorial on using Pytorch to implement BiLSTM-CRF</a>, author implements the following function. In specific, I am not quite understand what does <code>max_score_broadcast = max_score.view(1, -1).expand(1, vec.size()[1])</code> try to do?, or which kind of math formula it corresponds to?</p>
  
  <pre><code># Compute log sum exp in a numerically stable way for the forward algorithm
  def log_sum_exp(vec):
      max_score = vec[0, argmax(vec)]
      max_score_broadcast = max_score.view(1, -1).expand(1, vec.size()[1])
      return max_score + \
          torch.log(torch.sum(torch.exp(vec - max_score_broadcast)))
  </code></pre>