class_docstr: As the joint influence from external environment and internal cognition, different kinds of user interests are
  evolving over time. Interest Evolving Layer can capture interest evolving process that is relative to the target
  item.
docstr: get the last effective value in the interest evolution sequence
  Args:
      outputs (torch.Tensor): the output of `DynamicRNN` after `pad_packed_sequence`
      keys_length (torch.Tensor): the true length of the user history sequence
  
  Returns:
      torch.Tensor: The user's CTR for the next item
docstr_tok: ["get","the","last","effective","value","in","the","interest","evolution","sequence","Args",":","outputs","(","torch.Tensor",")",":","the","output","of","`","DynamicRNN","`","after","`","pad_packed_sequence","`","keys_length","(","torch.Tensor",")",":","the","true","length","of","the","user","history","sequence","Returns",":","torch.Tensor",":","The","user","'s","CTR","for","the","next","item"]
code: def final_output(self, outputs, keys_length):
      """get the last effective value in the interest evolution sequence
      Args:
          outputs (torch.Tensor): the output of `DynamicRNN` after `pad_packed_sequence`
          keys_length (torch.Tensor): the true length of the user history sequence
  
      Returns:
          torch.Tensor: The user's CTR for the next item
      """
      batch_size, hist_len, _ = outputs.shape  # [B, T, H]
  
      mask = torch.arange(hist_len, device=keys_length.device).repeat(
          batch_size, 1
      ) == (keys_length.view(-1, 1) - 1)
  
      return outputs[mask]
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.init import xavier_normal_, constant_
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence, PackedSequence
  from recbole.utils import ModelType, InputType, FeatureType
  from recbole.model.layers import FMEmbedding, MLPLayers, ContextSeqEmbLayer, SequenceAttLayer
  from recbole.model.abstract_recommender import SequentialRecommender
label_desc: Use image node_id 2 for calling the InterestEvolvingLayer obj's underlying member method code with example usage: obj.final_output(outputs, keys_length) and returns: outputs