original_docstring: Embeds each center on a discrete grid.
  
      Args:
        centers: center location of cells (n_cells x 2).
        resolution: Float specifying the resolution of grid.
  
      Returns:
        centers_grid : Discretized centers (n_cells x 2).
        grid_size : dimensions of the grid (2D integer tuple).
        map_cell_grid : mapping between cells to grid (grid_x x grid_y x n_cells)
      
docstring: Embeds each center on a discrete grid.
docstring_tokens: Embeds each center on a discrete grid .
code: def _give_cell_grid(self, centers, resolution):
      """Embeds each center on a discrete grid.
  
      Args:
        centers: center location of cells (n_cells x 2).
        resolution: Float specifying the resolution of grid.
  
      Returns:
        centers_grid : Discretized centers (n_cells x 2).
        grid_size : dimensions of the grid (2D integer tuple).
        map_cell_grid : mapping between cells to grid (grid_x x grid_y x n_cells)
      """
  
      n_cells = centers.shape[0]
      centers_grid = np.floor(centers / resolution)
      centers_grid -= np.min(centers_grid, 0)
      grid_size = np.max(centers_grid, 0).astype(np.int32) + 1
  
      # map_cell_grid is location of each cell to grid point
      map_cell_grid = np.zeros((grid_size[0], grid_size[1], n_cells))
      for icell in range(n_cells):
        map_cell_grid[centers_grid[icell, 0], centers_grid[icell, 1], icell] = 1
      tf.logging.info('Centers made into grid points')
  
      return centers_grid, grid_size, map_cell_grid
code_tokens: def _give_cell_grid ( self , centers , resolution ) : n_cells = centers . shape [ 0 ] centers_grid = np . floor ( centers / resolution ) centers_grid -= np . min ( centers_grid , 0 ) grid_size = np . max ( centers_grid , 0 ) . astype ( np . int32 ) + 1 map_cell_grid = np . zeros ( ( grid_size [ 0 ] , grid_size [ 1 ] , n_cells ) ) for icell in range ( n_cells ) : map_cell_grid [ centers_grid [ icell , 0 ] , centers_grid [ icell , 1 ] , icell ] = 1 tf . logging . info ( 'Centers made into grid points' ) return centers_grid , grid_size , map_cell_grid
short_docstring: Embeds each center on a discrete grid.
short_docstring_tokens: Embeds each center on a discrete grid .
comment: """Embeds each center on a discrete grid.
  
      Args:
        centers: center location of cells (n_cells x 2).
        resolution: Float specifying the resolution of grid.
  
      Returns:
        centers_grid : Discretized centers (n_cells x 2).
        grid_size : dimensions of the grid (2D integer tuple).
        map_cell_grid : mapping between cells to grid (grid_x x grid_y x n_cells)
      """$SEP$# map_cell_grid is location of each cell to grid point