MCPcopy Create free account
hub / github.com/DeepGraphLearning/S3F / randn

Function randn

s3f/gvp_layer.py:41–52  ·  view source on GitHub ↗

Returns random tuples (s, V) drawn elementwise from a normal distribution. :param n: number of data points :param dims: tuple of dimensions (n_scalar, n_vector) :return: (s, V) with s.shape = (n, n_scalar) and V.shape = (n, n_vector, 3)

(n, dims, device="cpu")

Source from the content-addressed store, hash-verified

39
40
41def randn(n, dims, device="cpu"):
42 '''
43 Returns random tuples (s, V) drawn elementwise from a normal distribution.
44
45 :param n: number of data points
46 :param dims: tuple of dimensions (n_scalar, n_vector)
47
48 :return: (s, V) with s.shape = (n, n_scalar) and
49 V.shape = (n, n_vector, 3)
50 '''
51 return torch.randn(n, dims[0], device=device), \
52 torch.randn(n, dims[1], 3, device=device)
53
54
55def _norm_no_nan(x, axis=-1, keepdims=False, eps=1e-8, sqrt=True):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected