Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion spacy_curated_transformers/models/architectures.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,11 @@ def _convert_inputs(
span = X[i]
span_len = span.shape[0]
Xt[i, :span_len] = span
Xt = xp2torch(Xt)
if ops.device_type == 'gpu':
device = torch.device(f"cuda:{ops.device_id}")
Xt = xp2torch(Xt, device=device)
else:
Xt = xp2torch(Xt)

def convert_from_torch_backward(d_inputs: Any):
# No gradients for the inputs.
Expand Down