Exemple #1
0
 def test_from_np1d(self):
   npa = np.random.random((100, 100))
   np.save('_test_write1', npa)
   np.savez('_test_write2', npa)
   t1 = expr.from_file('_test_write1.npy', sparse = False)
   t2 = expr.from_file('_test_write2.npz', sparse = False)
   t3 = expr.from_numpy(npa)
   Assert.all_eq(t1.glom(), npa)
   Assert.all_eq(t2.glom(), npa)
   Assert.all_eq(t3.glom(), npa)
   os.system('rm -rf _test_write1.npy _test_write2.npz')
def loadVector(ctx, dim):
	path = r"/home/wangpeng/spartan-study/vector"
	return expr.from_file(path, "numpy", tile_hint = (dim / ctx.num_workers, 1))