code: def _sensoryComputeInferenceMode(self, anchorInput):
      
      if len(anchorInput) == 0:
        return
  
      overlaps = self.connections.computeActivity(anchorInput,
                                                  self.connectedPermanence)
      activeSegments = np.where(overlaps >= self.activationThreshold)[0]
  
      sensorySupportedCells = np.unique(
        self.connections.mapSegmentsToCells(activeSegments))
  
      inactivated = np.setdiff1d(self.activeCells, sensorySupportedCells)
      inactivatedIndices = np.in1d(self.cellsForActivePhases,
                                   inactivated).nonzero()[0]
      if inactivatedIndices.size > 0:
        self.activePhases = np.delete(self.activePhases, inactivatedIndices,
                                      axis=0)
  
      activated = np.setdiff1d(sensorySupportedCells, self.activeCells)
  
      # Find centers of point clouds
      if "corners" in self.anchoringMethod:
        activatedCoordsBase = np.transpose(
          np.unravel_index(sensorySupportedCells,
                           self.cellDimensions)).astype('float')
      else:
        activatedCoordsBase = np.transpose(
          np.unravel_index(activated, self.cellDimensions)).astype('float')
  
      # Generate points to add
      activatedCoords = np.concatenate(
        [activatedCoordsBase + [iOffset, jOffset]
         for iOffset in self.cellCoordinateOffsets
         for jOffset in self.cellCoordinateOffsets]
      )
      if "corners" in self.anchoringMethod:
        self.activePhases = activatedCoords / self.cellDimensions
  
      else:
        if activatedCoords.size > 0:
          self.activePhases = np.append(self.activePhases,
                                        activatedCoords / self.cellDimensions,
                                        axis=0)
  
      self._computeActiveCells()
      self.activeSegments = activeSegments
      self.sensoryAssociatedCells = sensorySupportedCells
docs: Infer the location from sensory input. Activate any cells with enough active
      synapses to this sensory input. Deactivate all other cells.
  
      @param anchorInput (numpy array)
      A sensory input. This will often come from a feature-location pair layer.