code: def make_bernoulli_masks(shape, pm, outer_masks=1.0):
      bb = shape[0]
      tt = shape[1]
      pp = shape[2]
      ii = shape[3]
      probs = tf.random_uniform([bb, tt, ii])
      masks = tf.tile(
          tf.to_float(tf.less(probs, pm))[:, :, None, :], [1, 1, pp, 1]
      )
      return masks * outer_masks
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import time
  from magenta.models.coconet import lib_graph
  from magenta.models.coconet import lib_hparams
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: make_bernoulli_masks(shape, pm, outer_masks) and returns: unknown