MCPcopy Create free account
hub / github.com/BioinfoMachineLearning/FlowDock / inplace_to_torch

Function inplace_to_torch

flowdock/utils/model_utils.py:252–260  ·  view source on GitHub ↗

Convert NumPy sample to PyTorch tensors.

(sample)

Source from the content-addressed store, hash-verified

250
251
252def inplace_to_torch(sample):
253 """Convert NumPy sample to PyTorch tensors."""
254 if sample is None:
255 return None
256 sample["features"] = {k: torch.FloatTensor(v) for k, v in sample["features"].items()}
257 sample["indexer"] = {k: torch.LongTensor(v) for k, v in sample["indexer"].items()}
258 if "labels" in sample.keys():
259 sample["labels"] = {k: torch.FloatTensor(v) for k, v in sample["labels"].items()}
260 return sample
261
262
263def distance_to_gaussian_contact_logits(

Callers 2

multi_pose_samplingFunction · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected