code: def _compare_params(
      self,
      local_module,
      dist_module,
      rank0_only,
      skip_rowwise_bias=False,
      compare_grad=False,
  ):
      replicate = [Replicate()]
      for name, param in local_module.named_parameters():
          dist_param = dist_module.get_parameter(name)
          param = param.grad if compare_grad else param
          dist_param = dist_param.grad if compare_grad else dist_param
          if (
              (not rank0_only)
              or (self.rank == 0)
              or (
                  name not in ["net2.bias"]
                  and not skip_rowwise_bias
                  or name not in ["bias", "net2.bias"]
              )
          ):
              self.assertEqual(
                  param,
                  dist_param.redistribute(
                      device_mesh=dist_param.device_mesh,
                      placements=replicate,
                  ).to_local(),
                  f"{name} not equal between dist and non-dist",
              )
  
imports: from collections import OrderedDict
  import torch
  from torch.distributed._tensor import DeviceMesh, DTensor, Replicate, Shard
  from torch.distributed.tensor.parallel._utils import _create_1d_device_mesh
  from torch.distributed.tensor.parallel.api import parallelize_module
  from torch.distributed.tensor.parallel.style import ColwiseParallel, PrepareModuleInput, PrepareModuleOutput, RowwiseParallel
  from torch.testing._internal.common_utils import run_tests
  from torch.testing._internal.distributed._tensor.common_dtensor import DTensorTestBase, MLPModule, with_comms
label_desc: Use image node_id 4 for calling the TensorParallelAPITests obj's underlying member method code with example usage: obj._compare_params(local_module, dist_module, rank0_only, skip_rowwise_bias, compare_grad) without return types