code: def expert_params(device):
      model_dim = 8
      num_experts = 4
      gate = Top2Gate(model_dim, num_experts)
      expert = torch.nn.Linear(model_dim, model_dim)
      moe = MOELayer(gate, expert).to(device)
      for p in expert.parameters():
          assert p.expert is True, str(p.expert)
  
imports: import functools
  import tempfile
  import pytest
  import torch
  import torch.distributed
  import torch.multiprocessing
  from fairscale.fair_dev.testing.testing import make_cudnn_deterministic
  from fairscale.internal import torch_version
  from fairscale.nn import MOELayer, Top2Gate
label_desc: Use image node_id 4 for calling a global function with example usage: expert_params(device) without return types