mirror of
https://github.com/wassname/ray.git
synced 2026-09-11 12:43:20 +08:00
change directory structure, rename array libraries (#87)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
import halo.arrays.remote as ra
|
||||
import halo
|
||||
|
||||
from core import *
|
||||
|
||||
@halo.remote([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] = ra.random.normal(DistArray.compute_block_shape(index, shape))
|
||||
result = DistArray()
|
||||
result.construct(shape, objrefs)
|
||||
return result
|
||||
Reference in New Issue
Block a user