Agent skill · research science · k-dense-ai
torchdrug
Build and troubleshoot TorchDrug 0.2.1 workflows for molecular graphs, property prediction, self-supervised pretraining, molecule generation, retrosynthesis, protein representation learning, and knowledge graph reasoning. Use when code imports torchdrug or needs its datasets, models, tasks, or Engine.
Why this skill is useful
Provides specific workflows and installation instructions for TorchDrug 0.2.1 that the AI wouldn't reliably generate on its own.
What it needs
Requires python, torch, torch-cluster, torch-scatter installed locally. About 5k tokens when loaded. Last updated 2026-08-03. 32,849 stars on the source repository.
What this skill does
TorchDrug Use TorchDrug as a modular PyTorch graph-learning stack: 1. load a datasets. dataset, 2. choose a models. representation model, 3. wrap it in a tasks. objective, 4. train and evaluate it with core.Engine. The current official documentation and latest release are both 0.2.1. Treat newer Python or PyTorch combinations as unverified rather than silently assuming compatibility. Start with the version guard Before generating or debugging code, inspect the environment: The supported matrix for TorchDrug 0.2.1 is: Python 3.7 through 3.10 PyTorch 1.8 through 2.0 Linux, Windows, or macOS Apple Silicon: PyTorch 1.13 or later, CPU only; no MPS support If the project uses Python 3.11+ or PyTorch 2.1+, create a compatible environment or explicitly test a source build. Do not present such combinations as supported. Installation Prefer a dedicated Python 3.10 environment and pin the TorchDrug release: Install torch-scatter and torch-cluster wheels matched to the exact PyTorch and CUDA pair, following the official installation page. For a CPU-only PyTorch 2.0 environment, one reproducible wheel combination is: Do not copy a CUDA wheel URL between environments. Match the PyTorch version, CUDA build, Python ABI, and platform. On Apple Silicon, the official docs require building torch-scatter and torch-cluster from source; pin reviewed source revisions and expect CPU execution. Canonical property-prediction workflow Use the documented ClinTox → GIN → PropertyPrediction → Engine pattern: Add gpus=[0] only when a supported CUDA device is available. Omit gpus for CPU execution. For binary classification, task.predict(batch) returns logits; apply torch.sigmoid when probabilities are needed. In 0.2.1, normalized regression predictions are returned on the original target scale, which is a breaking change from older releases. Choose the official workflow Molecular property prediction Dataset: datasets.ClinTox, BBBP, Tox21, QM9, or another documented molecule dataset. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills k-dense-ai/torchdrug