本文整理汇总了Python中distarray.local.localarray.LocalArray.from_distarray方法的典型用法代码示例。如果您正苦于以下问题:Python LocalArray.from_distarray方法的具体用法?Python LocalArray.from_distarray怎么用?Python LocalArray.from_distarray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distarray.local.localarray.LocalArray
的用法示例。
在下文中一共展示了LocalArray.from_distarray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_values
# 需要导入模块: from distarray.local.localarray import LocalArray [as 别名]
# 或者: from distarray.local.localarray.LocalArray import from_distarray [as 别名]
def test_values(self):
if self.comm.Get_rank() == 0:
assert_array_equal(np.arange(20), self.larr.ndarray)
elif self.comm.Get_rank() == 1:
assert_array_equal(np.arange(30), self.larr.ndarray)
larr = LocalArray.from_distarray(self.larr, comm=self.comm)
if self.comm.Get_rank() == 0:
assert_array_equal(np.arange(20), larr.ndarray)
elif self.comm.Get_rank() == 1:
assert_array_equal(np.arange(30), larr.ndarray)
示例2: test_round_trip_elements
# 需要导入模块: from distarray.local.localarray import LocalArray [as 别名]
# 或者: from distarray.local.localarray.LocalArray import from_distarray [as 别名]
def test_round_trip_elements(self):
larr = LocalArray.from_distarray(self.larr, comm=self.comm)
if self.comm.Get_rank() == 0:
idx = (0,) * larr.ndarray.ndim
larr.ndarray[idx] = 99
assert_array_equal(larr.ndarray, self.larr.ndarray)
示例3: test_round_trip_equality_from_dict
# 需要导入模块: from distarray.local.localarray import LocalArray [as 别名]
# 或者: from distarray.local.localarray.LocalArray import from_distarray [as 别名]
def test_round_trip_equality_from_dict(self):
larr = LocalArray.from_distarray(self.larr.__distarray__(),
comm=self.comm)
self.assert_round_trip_equality(larr)
示例4: test_round_trip_equality_from_object
# 需要导入模块: from distarray.local.localarray import LocalArray [as 别名]
# 或者: from distarray.local.localarray.LocalArray import from_distarray [as 别名]
def test_round_trip_equality_from_object(self):
larr = LocalArray.from_distarray(comm=self.comm, obj=self.larr)
self.assert_round_trip_equality(larr)