docstr: Tests that passing heterogeneous values for attributes designated as
  homogeneous raises an error.
docstr_tok: ["Tests","that","passing","heterogeneous","values","for","attributes","designated","as","homogeneous","raises","an","error","."]
code: def test_homogeneous_attributes(self):
      """
      Tests that passing heterogeneous values for attributes designated as
      homogeneous raises an error.
      """
      # Manually construct this list but verify against the global list of
      # homogeneous attribute names
      all_attr_name_and_values = [
          ("_use_orig_params", False, True),
          ("limit_all_gathers", False, True),
          ("_use_full_prec_in_eval", False, True),
      ]
      self.assertEqual(
          [
              attr_name_and_values[0]
              for attr_name_and_values in all_attr_name_and_values
          ],
          HOMOGENEOUS_ATTR_NAMES,
      )
  
      self.run_subtests(
          {"attr_name_and_values": all_attr_name_and_values},
          self._test_homogeneous_attributes,
      )
  
imports: import functools
  import os
  import sys
  import warnings
  from collections import namedtuple
  from contextlib import nullcontext
  from copy import deepcopy
  from itertools import chain
  from typing import Any, Tuple
  import torch
  import torch.distributed
  import torch.distributed.fsdp._traversal_utils
  import torch.nn
  from torch.distributed.fsdp import CPUOffload, FlatParameter, FullyShardedDataParallel, ShardingStrategy
  from torch.distributed.fsdp._flat_param import _FSDP_USE_UNSAFE_SETATTR
  from torch.distributed.fsdp._runtime_utils import HOMOGENEOUS_ATTR_NAMES
  from torch.distributed.fsdp.wrap import always_wrap_policy, ModuleWrapPolicy, transformer_auto_wrap_policy
  from torch.distributed.optim import _apply_optimizer_in_backward
  from torch.nn import TransformerDecoderLayer, TransformerEncoderLayer
  from torch.nn.parallel import DistributedDataParallel
  from torch.testing._internal.common_distributed import skip_if_lt_x_gpu
  from torch.testing._internal.common_fsdp import _assert_module_states, CUDAInitMode, FSDPInitMode, FSDPTest, FSDPTestMultiThread, NestedWrappedModule, TransformerWithSharedParams
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, parametrize, run_tests, TEST_WITH_DEV_DBG_ASAN
label_desc: Use image node_id 15 for calling the TestFSDPMiscMultiThread obj's underlying member method code with example usage: obj.test_homogeneous_attributes() without return types