code: def _dense_to_sparse(dense: np.ndarray) -> List[Dict[str, float]]:
      """Convert dense array to sparse representation"""
      assert len(dense.shape) == 2, f"dense shape is {dense.shape}"
      # pyre-fixme[7]: Expected `List[Dict[str, float]]` but got `List[Dict[int,
      #  typing.Any]]`.
      return [
          {i: v.item() for i, v in enumerate(elem)} for elem in dense
      ]
  
imports: import logging
  from typing import Dict, List
  import numpy
  import pandas
  from reagent.replay_memory.circular_replay_buffer import ReplayBuffer
label_desc: Use image node_id 1 for calling a global function with example usage: _dense_to_sparse(dense) and returns: unknown