code: def sent_lm_loss(self, sent):
      rnn_cur = self.rnn.initial_state()
      losses = []
      prev_word = self.start
      for word in sent:
          x_t = self.embeddings[prev_word]
          rnn_cur = rnn_cur.add_input(x_t)
          logits = dy.affine_transform(
              [self.lb, self.h2l, rnn_cur.output()]
          )
          losses.append(dy.pickneglogsoftmax(logits, word))
          prev_word = word
      return dy.esum(losses)
  
file_path: dynet/examples/rnnlm/lstmlm-auto.py
imports: from __future__ import print_function
  from collections import defaultdict
  import math
  import random
  import time
  import dynet
label_desc: Use image node_id 2 for calling the LSTMLM obj's underlying member method code with example usage: obj.sent_lm_loss(sent) and returns: dy