Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ray / purelib / ray / experimental / array / distributed / random.py
Size: Mime:
import numpy as np

import ray
import ray.experimental.array.remote as ra
from .core import DistArray


@ray.remote
def normal(shape):
    num_blocks = DistArray.compute_num_blocks(shape)
    object_refs = np.empty(num_blocks, dtype=object)
    for index in np.ndindex(*num_blocks):
        object_refs[index] = ra.random.normal.remote(
            DistArray.compute_block_shape(index, shape)
        )
    result = DistArray(shape, object_refs)
    return result