mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-03 10:06:44 +00:00
[tensor] revert local view back (#1178)
This commit is contained in:
@@ -67,14 +67,14 @@ def _run_view(world_size):
|
||||
TensorSpec(distspec.shard(process_group=gpc.get_group(ParallelMode.DATA), dims=[0],
|
||||
num_partitions=[world_size])))
|
||||
|
||||
assert t.size()[0] == 4 * world_size
|
||||
assert t.size(1) == 5
|
||||
assert t.size() == torch.Size([4 * world_size, 5])
|
||||
assert t.size_global()[0] == 4 * world_size
|
||||
assert t.size_global(1) == 5
|
||||
assert t.size_global() == torch.Size([4 * world_size, 5])
|
||||
|
||||
t.view_base(4 * 5)
|
||||
t.view_local(4 * 5)
|
||||
assert t.tensor_spec.dist_spec.placement.value == 's'
|
||||
|
||||
t = t.view(4 * 5 * world_size)
|
||||
t = t.view_global(4 * 5 * world_size)
|
||||
assert t.tensor_spec.dist_spec.placement.value == 'r'
|
||||
assert t.shape == torch.Size([4 * 5 * world_size])
|
||||
|
||||
|
Reference in New Issue
Block a user