@staticmethod<EOL><INDENT>def new(params, num_components, component_layer,<EOL>validate_args=False, name=None):<DEDENT>
with tf.compat.v1.name_scope(name, '<STR_LIT>',<EOL>[params, num_components, component_layer]):<EOL><INDENT>params = tf.convert_to_tensor(value=params, name='<STR_LIT>')<EOL>num_components = tf.convert_to_tensor(<EOL>value=num_components, name='<STR_LIT>', dtype_hint=tf.int32)<EOL>components_dist = component_layer(<EOL>tf.reshape(<EOL>params[..., num_components:],<EOL>tf.concat([tf.shape(input=params)[:-<NUM_LIT:1>], [num_components, -<NUM_LIT:1>]],<EOL>axis=<NUM_LIT:0>)))<EOL>mixture_dist = tfd.Categorical(logits=params[..., :num_components])<EOL>return tfd.MixtureSameFamily(<EOL>mixture_dist,<EOL>components_dist,<EOL>validate_args=False)<EOL><DEDENT>
Create the distribution instance from a `params` vector.