2 writes to Device
Microsoft.ML.TorchSharp (2)
Roberta\QATrainer.cs (2)
201
Device
= TorchUtils.InitializeDevice(Parent.Host);
209
Device
= TorchUtils.InitializeDevice(Parent.Host);
6 references to Device
Microsoft.ML.TorchSharp (6)
Roberta\QATrainer.cs (6)
212
if (
Device
.type == DeviceType.CUDA)
352
srcTensor = PrepareBatchTensor(ref inputTensors, device:
Device
, Tokenizer.RobertaModel().PadIndex);
353
targetTensor = PrepareBatchTensor(ref targetTensors, device:
Device
, 0);
386
return DataUtils.CollateTokens(inputTensors, padIndex, device:
Device
);
422
var srcTensor = torch.tensor((new[] { 0 /* InitToken */ }).Concat(questionTokenId).Concat(new[] { 2 /* SeparatorToken */ }).Concat(contextTokenId).ToList(), device:
Device
);
429
var labelTensor = torch.tensor(targetList, device:
Device
);