code: def _swap_out_optimizer_state(
      self, aio_handle, parameter, swap_in_op
  ):
      assert swap_in_op.is_parameter(parameter)
  
      allocated_buffers = swap_in_op.allocated_buffers.copy()
      swap_buffers = swap_in_op.state_buffers.copy()
  
      param_info = swap_in_op.param_info
      self._update_param_state_info(param_info, parameter)
      unpinned_tensors = param_info.get_unpinned_state_tensors()
  
      if len(unpinned_tensors) > 0:
          new_alloc_buffers = self.swap_buffer_manager.allocate(
              num_elems=self._io_aligned_numel(param_info.numel()),
              count=len(unpinned_tensors),
              dtype=param_info.dtype(),
          )
          assert new_alloc_buffers is not None
  
          allocated_buffers += new_alloc_buffers
          swap_buffers += new_alloc_buffers
  
          for pinned_dst, unpinned_src in zip(
              new_alloc_buffers, unpinned_tensors
          ):
              dst = get_sized_buffer(pinned_dst, unpinned_src.numel())
              dst.data.copy_(unpinned_src.data)
  
      swap_paths = param_info.swap_paths.copy()
      assert len(swap_paths) == len(swap_buffers)
  
      swap_out_tensors(aio_handle, swap_buffers, swap_paths)
  
      swap_out_op = OptimizerSwapOp(
          aio_handle=aio_handle,
          param_info=param_info,
          read_op=False,
          allocated_buffers=allocated_buffers,
          state_buffers=swap_buffers,
          num_ops=len(swap_buffers),
      )
  
      return swap_out_op
  
imports: from deepspeed.ops.aio import AsyncIOBuilder
  from deepspeed import comm
  from deepspeed.runtime.swap_tensor.constants import *
  from deepspeed.runtime.swap_tensor.utils import swap_in_tensors, swap_out_tensors, print_object
  from deepspeed.runtime.swap_tensor.async_swapper import AsyncTensorSwapper
  from deepspeed.runtime.swap_tensor.utils import get_sized_buffer
  from deepspeed.runtime.swap_tensor.optimizer_utils import OptimizerSwapper
label_desc: Use image node_id 9 for calling the PipelinedOptimizerSwapper obj's underlying member method code with example usage: obj._swap_out_optimizer_state(aio_handle, parameter, swap_in_op) and returns: swap_out_op