Skip to content

Commit

Permalink
fix key conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ziw-liu committed Oct 17, 2024
1 parent c4c0bf9 commit 5e12916
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion viscy/representation/embedding_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _move_and_stack_embeddings(
predictions: Sequence[ContrastivePrediction], key: str
) -> NDArray:
"""Move embeddings to CPU and stack them into a numpy array."""
return torch.cat([p["features"].cpu() for p in predictions], dim=0).numpy()
return torch.cat([p[key].cpu() for p in predictions], dim=0).numpy()


class EmbeddingWriter(BasePredictionWriter):
Expand Down

0 comments on commit 5e12916

Please sign in to comment.