(input_logits, output_shape, num_samples, program=None)
return samples_var
Multinomial
        input_logits's dimension is [M * D]
        output_shape's dimension is [M * num_samples]
Multinomial
        input_logits's dimension is [M * D]
        output_shape's dimension is [M * num_samples]
Multinomial input_logits s dimension is [ M * D ] output_shape s dimension is [ M * num_samples ]
def multinomial(input_logits, output_shape, num_samples, program=None):
    """
        Multinomial
        input_logits's dimension is [M * D]
        output_shape's dimension is [M * num_samples]
    """
    samples_var = create_tmp_var(name='multinomial_result_var',
                                 dtype='int32', shape=output_shape,
                                 program=program)
    num_samples_var = fluid.layers.fill_constant(shape=[1], value=num_samples,
                                                 dtype='int32')
    fluid.layers.py_func(func=py_func_multinomial,
                         x=[input_logits, num_samples_var],
                         out=samples_var, backward_func=None,
                         skip_vars_in_backward_input=None)
    return samples_var
def multinomial ( input_logits , output_shape , num_samples , program = None ) : samples_var = create_tmp_var ( name = 'multinomial_result_var' , dtype = 'int32' , shape = output_shape , program = program ) num_samples_var = fluid . layers . fill_constant ( shape = [ 1 ] , value = num_samples , dtype = 'int32' ) fluid . layers . py_func ( func = py_func_multinomial , x = [ input_logits , num_samples_var ] , out = samples_var , backward_func = None , skip_vars_in_backward_input = None ) return samples_var