code: def test_simple_moe_layer():
      inference_model = DummyInferenceModel(experts_per_rank=2)
  
      simple_moe_layer = SimpleMoELayer(inference_model)
  
      assert simple_moe_layer.moe_mlp_1.experts[0] is None
      assert simple_moe_layer.moe_mlp_1.experts[1] is None
  
      # Set the first expert
      simple_moe_layer.moe_mlp_1.experts[0] = torch.zeros(16, 16)
  
      assert simple_moe_layer.moe_mlp_1.experts[0] is not None
      assert simple_moe_layer.moe_mlp_1.experts[1] is None
  
      assert not simple_moe_layer.is_initialized
  
      # Set the second expert
      simple_moe_layer.moe_mlp_1.experts[1] = torch.ones(16, 16)
  
      # We have all the experts, so the layer should be initialized
      assert simple_moe_layer.is_initialized
      assert isinstance(simple_moe_layer.moe_mlp_1, torch.Tensor)
  
      validate_device(simple_moe_layer.moe_mlp_1)
  
imports: import pytest
  import torch
  from deepspeed.inference.v2.allocator import on_device
  from deepspeed.inference.v2.inference_parameter import InferenceParameter
  from deepspeed.inference.v2.model_implementations.parameter_base import ParameterBase, ParamList
  from deepspeed.inference.v2.model_implementations.layer_container_base import LayerContainer
  from deepspeed.inference.v2.model_implementations.common_parameters import *
  from .utils import validate_device
label_desc: Use image node_id 1 for calling a global function with example usage: test_simple_moe_layer() without return types