(input_logits, output_shape, program=None)
return samples_var
Bernoulli
Bernoulli
Bernoulli
def bernoulli(input_logits, output_shape, program=None):
    """
        Bernoulli
    """
    # the output_shape is the same as input_logits
    samples_var = create_tmp_var(name='binomial_result_var',
                                 dtype='float32', shape=output_shape,
                                 program=program)
    fluid.layers.py_func(func=py_func_bernoulli, x=input_logits,
                         out=samples_var, backward_func=None,
                         skip_vars_in_backward_input=None)
    return samples_var
def bernoulli ( input_logits , output_shape , program = None ) : # the output_shape is the same as input_logits samples_var = create_tmp_var ( name = 'binomial_result_var' , dtype = 'float32' , shape = output_shape , program = program ) fluid . layers . py_func ( func = py_func_bernoulli , x = input_logits , out = samples_var , backward_func = None , skip_vars_in_backward_input = None ) return samples_var