mirror of
https://github.com/wassname/ray.git
synced 2026-07-17 11:32:33 +08:00
change filenames and directory structure to use halo (#81)
This commit is contained in:
committed by
Philipp Moritz
parent
b58eaf84ee
commit
67086f663e
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
import arrays.single as single
|
||||
import halo
|
||||
|
||||
from core import *
|
||||
|
||||
@halo.distributed([List[int]], [DistArray])
|
||||
def normal(shape):
|
||||
num_blocks = DistArray.compute_num_blocks(shape)
|
||||
objrefs = np.empty(num_blocks, dtype=object)
|
||||
for index in np.ndindex(*num_blocks):
|
||||
objrefs[index] = single.random.normal(DistArray.compute_block_shape(index, shape))
|
||||
result = DistArray()
|
||||
result.construct(shape, objrefs)
|
||||
return result
|
||||
Reference in New Issue
Block a user