Follow-up from review of #52.
scPrint._predict resets self.pred to None after every max_size_in_mem-sized chunk (so the GPU buffer doesn't grow unbounded), and log_adata() writes the current chunk to disk as a numbered predict_part_<n>.h5ad.
For the standard keep_all_cls_pred=False argmax path, that's fine: each part is self-contained and the argmaxes live in adata.obs.
For keep_all_cls_pred=True, the new dict[clsname → tensor] only ever contains the last buffer at the moment Embedder.__call__ writes columns into adata.obs. #52 added a defensive trailing-rows alignment so we don't silently corrupt, but the proper fix is to persist the per-head logits into each predict_part_<n>.h5ad (or accumulate them on CPU) and re-merge in the Embedder caller.
Probably wants to:
- pass
model.pred (when dict) through log_adata and write it into adata.obsm["cls_logits_<clsname>"] or similar in each part,
- have
Embedder.__call__ concat across all written parts at the end instead of relying on the live buffer.
Not urgent (the common case is one chunk), but worth tracking.
Refs #16, #52.
Follow-up from review of #52.
scPrint._predictresetsself.predtoNoneafter everymax_size_in_mem-sized chunk (so the GPU buffer doesn't grow unbounded), andlog_adata()writes the current chunk to disk as a numberedpredict_part_<n>.h5ad.For the standard
keep_all_cls_pred=Falseargmax path, that's fine: each part is self-contained and the argmaxes live inadata.obs.For
keep_all_cls_pred=True, the new dict[clsname → tensor]only ever contains the last buffer at the momentEmbedder.__call__writes columns intoadata.obs. #52 added a defensive trailing-rows alignment so we don't silently corrupt, but the proper fix is to persist the per-head logits into eachpredict_part_<n>.h5ad(or accumulate them on CPU) and re-merge in the Embedder caller.Probably wants to:
model.pred(when dict) throughlog_adataand write it intoadata.obsm["cls_logits_<clsname>"]or similar in each part,Embedder.__call__concat across all written parts at the end instead of relying on the live buffer.Not urgent (the common case is one chunk), but worth tracking.
Refs #16, #52.