MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / uniform_full_int

Method uniform_full_int

tensorflow/python/ops/stateful_random_ops.py:513–533  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 10

_make_int64_keysMethod · 0.95
testNewStateThreeFryMethod · 0.95
testNewStatePhiloxMethod · 0.95
testBatchSeedsMethod · 0.80
testGPUEqualsCPUMethod · 0.80
fMethod · 0.80
testSimpleMethod · 0.80
fMethod · 0.80
testXLAEqualsCPUMethod · 0.80

Calls 2

_shape_tensorFunction · 0.85
name_scopeMethod · 0.45

Tested by 9

testNewStateThreeFryMethod · 0.76
testNewStatePhiloxMethod · 0.76
testBatchSeedsMethod · 0.64
testGPUEqualsCPUMethod · 0.64
fMethod · 0.64
testSimpleMethod · 0.64
fMethod · 0.64
testXLAEqualsCPUMethod · 0.64