Uniform distribution on an integer type's entire range. The other method `uniform` only covers the range [minval, maxval), which cannot be `dtype`'s full range because `maxval` is of type `dtype`. Args: shape: the shape of the output. dtype: (optional) the integer type, def
(self, shape, dtype=dtypes.uint64, name=None)
| 511 | return math_ops.add(rnd * (maxval - minval), minval, name=name) |
| 512 | |
| 513 | def uniform_full_int(self, shape, dtype=dtypes.uint64, name=None): |
| 514 | """Uniform distribution on an integer type's entire range. |
| 515 | |
| 516 | The other method `uniform` only covers the range [minval, maxval), which |
| 517 | cannot be `dtype`'s full range because `maxval` is of type `dtype`. |
| 518 | |
| 519 | Args: |
| 520 | shape: the shape of the output. |
| 521 | dtype: (optional) the integer type, default to uint64. |
| 522 | name: (optional) the name of the node. |
| 523 | |
| 524 | Returns: |
| 525 | A tensor of random numbers of the required shape. |
| 526 | """ |
| 527 | dtype = dtypes.as_dtype(dtype) |
| 528 | with ops.name_scope(name, "stateful_uniform_full_int", |
| 529 | [shape]) as name: |
| 530 | shape = _shape_tensor(shape) |
| 531 | return gen_stateful_random_ops.stateful_uniform_full_int( |
| 532 | self.state.handle, self.algorithm, shape=shape, |
| 533 | dtype=dtype, name=name) |
| 534 | |
| 535 | def binomial(self, shape, counts, probs, dtype=dtypes.int32, name=None): |
| 536 | """Outputs random values from a binomial distribution. |