code: def mask_prob(p, onehot_eos, finished):
      is_finished = L.cast(L.reshape(finished, [-1, 1]) != 0, "float32")
      p = (
          is_finished * (1.0 - L.cast(onehot_eos, "float32")) * -9999.0
          + (1.0 - is_finished) * p
      )
      return p
  
file_path: PaddleHub/modules/text/text_generation/reading_pictures_writing_poems_for_midautumn/MidAutumnPoetry/model/decode.py
imports: import re
  import numpy
  from collections import namedtuple
  import paddle.fluid
  import paddle.fluid.layers
  import paddle.fluid.dygraph
label_desc: Use image node_id 4 for calling a global function with example usage: mask_prob(p, onehot_eos, finished) and returns: p