def subtractSpecificComps(self, PB, compIDs):
    assert len(compIDs) == PB.K
    for key in self._FieldDims:
      arr = getattr(self, key)
      if arr.ndim > 0:
        arr[compIDs] -= getattr(PB, key)
      else:
        self.setField(key, arr - getattr(PB, key), dims=None)
Subtract (in-place) from certain components of self the entire bag PB
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/suffstats/ParamBag.py/ParamBag.subtractSpecificComps