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

Method normal

tensorflow/python/ops/stateful_random_ops.py:394–416  ·  view source on GitHub ↗

Outputs random values from a normal distribution. Args: shape: A 1-D integer Tensor or Python array. The shape of the output tensor. mean: A 0-D Tensor or Python value of type `dtype`. The mean of the normal distribution. stddev: A 0-D Tensor or Python value of

(self, shape, mean=0.0, stddev=1.0, dtype=dtypes.float32,
             name=None)

Source from the content-addressed store, hash-verified

392 # The following functions return a tensor and as a side effect update
393 # self._state_var.
394 def normal(self, shape, mean=0.0, stddev=1.0, dtype=dtypes.float32,
395 name=None):
396 """Outputs random values from a normal distribution.
397
398 Args:
399 shape: A 1-D integer Tensor or Python array. The shape of the output
400 tensor.
401 mean: A 0-D Tensor or Python value of type `dtype`. The mean of the normal
402 distribution.
403 stddev: A 0-D Tensor or Python value of type `dtype`. The standard
404 deviation of the normal distribution.
405 dtype: The type of the output.
406 name: A name for the operation (optional).
407
408 Returns:
409 A tensor of the specified shape filled with random normal values.
410 """
411 with ops.name_scope(name, "stateful_normal", [shape, mean, stddev]) as name:
412 shape = _shape_tensor(shape)
413 mean = ops.convert_to_tensor(mean, dtype=dtype, name="mean")
414 stddev = ops.convert_to_tensor(stddev, dtype=dtype, name="stddev")
415 rnd = self._standard_normal(shape, dtype=dtype)
416 return math_ops.add(rnd * stddev, mean, name=name)
417
418 def _truncated_normal(self, shape, dtype):
419 return gen_stateful_random_ops.stateful_truncated_normal(

Callers 15

test_apply_transitionMethod · 0.80
test_gradients_existMethod · 0.80
mapMethod · 0.80
make_dataMethod · 0.80

Calls 4

_standard_normalMethod · 0.95
_shape_tensorFunction · 0.85
name_scopeMethod · 0.45
addMethod · 0.45

Tested by 15

test_apply_transitionMethod · 0.64
test_gradients_existMethod · 0.64
make_dataMethod · 0.64