def update(self, idx: Tensor, preds: Tensor, target: Tensor) -> None: """ Check shape, check and convert dtypes, flatten and add to accumulators. """ idx, preds, target = _check_retrieval_inputs(idx, preds, target, ignore=IGNORE_IDX) self.idx.append(idx.flatten()) self.preds.append(preds.flatten()) self.target.append(target.flatten())
def update(self, preds: Tensor, target: Tensor, indexes: Tensor = None) -> None: """ Check shape, check and convert dtypes, flatten and add to accumulators. """ if indexes is None: raise ValueError("`indexes` cannot be None") indexes, preds, target = _check_retrieval_inputs(indexes, preds, target) self.indexes.append(indexes) self.preds.append(preds) self.target.append(target)
def update(self, preds: Tensor, target: Tensor, indexes: Tensor) -> None: # type: ignore """ Check shape, check and convert dtypes, flatten and add to accumulators. """ if indexes is None: raise ValueError("Argument `indexes` cannot be None") indexes, preds, target = _check_retrieval_inputs( indexes, preds, target, allow_non_binary_target=self.allow_non_binary_target) self.indexes.append(indexes) self.preds.append(preds) self.target.append(target)