def __init__(self, shape, scope='<STR_LIT>', summary_labels=None):
self.shape = shape<EOL>self.scope = scope<EOL>self.summary_labels = set(summary_labels or ())<EOL>self.variables = dict()<EOL>self.all_variables = dict()<EOL>def custom_getter(getter, name, registered=False, **kwargs):<EOL><INDENT>variable = getter(name=name, registered=True, **kwargs)<EOL>if registered:<EOL><INDENT>pass<EOL><DEDENT>elif name in self.all_variables:<EOL><INDENT>assert variable is self.all_variables[name]<EOL>if kwargs.get('<STR_LIT>', True):<EOL><INDENT>assert variable is self.variables[name]<EOL>if '<STR_LIT>' in self.summary_labels:<EOL><INDENT>tf.contrib.summary.histogram(name=name, tensor=variable)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>self.all_variables[name] = variable<EOL>if kwargs.get('<STR_LIT>', True):<EOL><INDENT>self.variables[name] = variable<EOL>if '<STR_LIT>' in self.summary_labels:<EOL><INDENT>tf.contrib.summary.histogram(name=name, tensor=variable)<EOL><DEDENT><DEDENT><DEDENT>return variable<EOL><DEDENT>self.parameterize = tf.make_template(<EOL>name_=(scope + '<STR_LIT>'),<EOL>func_=self.tf_parameterize,<EOL>custom_getter_=custom_getter<EOL>)<EOL>self.sample = tf.make_template(<EOL>name_=(scope + '<STR_LIT>'),<EOL>func_=self.tf_sample,<EOL>custom_getter_=custom_getter<EOL>)<EOL>self.log_probability = tf.make_template(<EOL>name_=(scope + '<STR_LIT>'),<EOL>func_=self.tf_log_probability,<EOL>custom_getter_=custom_getter<EOL>)<EOL>self.entropy = tf.make_template(<EOL>name_=(scope + '<STR_LIT>'),<EOL>func_=self.tf_entropy,<EOL>custom_getter_=custom_getter<EOL>)<EOL>self.kl_divergence = tf.make_template(<EOL>name_=(scope + '<STR_LIT>'),<EOL>func_=self.tf_kl_divergence,<EOL>custom_getter_=custom_getter<EOL>)<EOL>self.regularization_loss = tf.make_template(<EOL>name_=(scope + '<STR_LIT>'),<EOL>func_=self.tf_regularization_loss,<EOL>custom_getter_=custom_getter<EOL>)<EOL>
Distribution.

Args:
    shape: Action shape.