code: def test_t_partial(self):
      device_mesh = DeviceMesh(
          self.device_type, list(range(self.world_size))
      )
  
      a = torch.randn(12, 8)
      b = torch.randn(8, 4)
      c = torch.mm(a, b).t()
  
      da = distribute_tensor(a, device_mesh, [Shard(1)])
      db = distribute_tensor(b, device_mesh, [Shard(0)])
  
      # mm(da, db) should return a _Partial tensor.
      # transposing it should keep it _Partial
      dc = torch.mm(da, db).t()
  
      self.assertTrue(isinstance(dc.placements[0], _Partial))
  
      # check that the local and distributed op results match
      self.assertEqual(
          c,
          dc.redistribute(device_mesh, [Replicate()]).to_local(),
      )
  
file_path: pytorch/test/distributed/_tensor/test_matrix_ops.py
imports: import itertools
  from typing import cast, List, Optional
  import torch
  from torch.distributed._tensor import DeviceMesh, distribute_tensor
  from torch.distributed._tensor.api import DTensor
  from torch.distributed._tensor.placement_types import _Partial, Placement, Replicate, Shard
  from torch.testing._internal.common_utils import run_tests
  from torch.testing._internal.distributed._tensor.common_dtensor import DTensorTestBase, skip_unless_torch_gpu, with_comms
label_desc: Use image node_id 5 for calling the DistMatrixOpsTest obj's underlying member method code with example usage: obj.test_t_partial() without return types