class_docstr: Mesh implemented using explicit device placement.
docstr: Call a random tf operation (e.g. tf.random.uniform).
  
  Args:
    shape: a Shape
    tf_fn: a function such as tf.random.uniform
    kwargs: kwargs to pass to tf_fn, except for seed
  
  Returns:
    a LaidOutTensor
docstr_tok: ["Call","a","random","tf","operation","(","e.g",".","tf.random.uniform",")",".","Args",":","shape",":","a","Shape","tf_fn",":","a","function","such","as","tf.random.uniform","kwargs",":","kwargs","to","pass","to","tf_fn",",","except","for","seed","Returns",":","a","LaidOutTensor"]
code: def random(self, shape, tf_fn, kwargs):
      """Call a random tf operation (e.g. tf.random.uniform).
  
      Args:
        shape: a Shape
        tf_fn: a function such as tf.random.uniform
        kwargs: kwargs to pass to tf_fn, except for seed
  
      Returns:
        a LaidOutTensor
      """
      slice_shape = self.slice_shape(shape)
      op_seed = random.random()
  
      def my_fn(pnum):
          # seeds are necessary to make sure that slices that should have the
          # same values actually do have the same values.
          seed = hash(
              "%s,%s" % (op_seed, self.slice_begin(shape, pnum))
          )
          return tf_fn(slice_shape, seed=seed, **kwargs)
  
      return self.slicewise(my_fn, self.laid_out_pnum())
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import os
  import random
  from mesh_tensorflow import ops_with_redefined_builtins
  from six.moves import xrange
  import tensorflow.compat.v1
label_desc: Use image node_id 9 for calling the PlacementMeshImpl obj's underlying member method code with example usage: obj.random(shape, tf_fn, kwargs) and returns: self, tf_fn