# RandomUniform¶

RandomUniform  // Operation that generates a tensor populated with random
// values of a uniform distribution.


## Description¶

Warning

This op is experimental and subject to change without notice.

### Inputs¶

Name Element Type Shape | Notes
min_value Any floating point type Scalar | Minimum value for the random distribution
max_value Same as max_value Scalar Maximum value for the random distribution
result_shape element::i64 Vector of any size Shape of the output tensor
use_fixed_seed element::boolean Scalar Flag indicating whether to use the fixed seed value fixed_seed (useful for testing)

### Attributes¶

Name Type Notes
fixed_seed uint64_t Fixed seed value to use if use_fixed_seed flag is set to 1. This should be used only for testing; if use_fixed_seed is 1, RandomUniform will produce the _same_ values at each iteration.

### Outputs¶

Name Element Type Shape
output Same as min_value result_shape

## Mathematical Definition¶

$\mathtt{output}_i = \mathtt{uniform_rand}(\mathtt{min}=\mathtt{min_value}, \mathtt{max}=\mathtt{max_value})$

## C++ Interface¶

class RandomUniform : public ngraph::op::Op

Generates a tensor populated with random values of a uniform distribution.

Public Functions

const NodeTypeInfo &get_type_info() const

Returns the NodeTypeInfo for the node’s class. During transition to type_info, returns a dummy type_info for Node if the class has not been updated yet.

RandomUniform()

Constructs an uninitialized RandomUniform node.

RandomUniform(const Output<Node> &min_value, const Output<Node> &max_value, const Output<Node> &result_shape, const Output<Node> &use_fixed_seed, uint64_t fixed_seed)

Constructs a RandomUniform node.

Parameters
• min_value: Output producing the minimum value (inclusive) for the random uniform distribution. Must return a scalar of floating point type, and the type must match that of max_value.
• max_value: Output producing the maximum value (inclusive) for the random uniform distribution. Must return a scalar of floating point type, and the type must match that of min_value.
• result_shape: Output producing the shape of the output tensor. Must return a vector of type element::i64.
• use_fixed_seed: Output producing a boolean scalar Flag indicating whether to use the value supplied in fixed_seed to re-seed the random number generator at this iteration. Note that whenever use_fixed_seed is true, the same values will be generated in the output tensor. This flag is primarily used for debugging. If use_fixed_seed is false, the value in fixed_seed is ignored.
• fixed_seed: Fixed seed value to be supplied to the random number generator if use_fixed_seed is true. If use_fixed_seed is false, this value is ignored.

uint64_t get_fixed_seed() const

Returns the fixed seed value to be supplied to the random number generator if use_fixed_seed is true. If use_fixed_seed is false, this value is ignored.

void set_fixed_seed(uint64_t fixed_seed)

Sets the fixed seed value to be supplied to the random number generator if use_fixed_seed is true. If use_fixed_seed is false, this value is ignored.

void validate_and_infer_types()

Throws if the node is invalid.