Skip to content

Commit

Permalink
Update collating_graphormer.py (huggingface#23862)
Browse files Browse the repository at this point in the history
  • Loading branch information
clefourrier authored and novice03 committed Jun 23, 2023
1 parent 22c10aa commit c8ff490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/graphormer/collating_graphormer.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ def __call__(self, features: List[dict]) -> Dict[str, Any]:
else: # binary classification
batch["labels"] = torch.from_numpy(np.concatenate([i["labels"] for i in features]))
else: # multi task classification, left to float to keep the NaNs
batch["labels"] = torch.from_numpy(np.stack([i["labels"] for i in features], dim=0))
batch["labels"] = torch.from_numpy(np.stack([i["labels"] for i in features], axis=0))

return batch

0 comments on commit c8ff490

Please sign in to comment.