code: def sparse_dropout(x, keep_prob, noise_shape):
      """Dropout for sparse tensors."""
      random_tensor = keep_prob
      random_tensor += tf.random_uniform(noise_shape)
      dropout_mask = tf.cast(tf.floor(random_tensor), dtype=tf.bool)
      pre_out = tf.sparse_retain(x, dropout_mask)
      return tf.SparseTensor(
          indices=pre_out.indices,
          values=pre_out.values / keep_prob,
          dense_shape=pre_out.dense_shape,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from .models_base import glorot
  from .models_base import Model
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: sparse_dropout(x, keep_prob, noise_shape) and returns: tf