7 references to DataUtils
Microsoft.ML.TorchSharp (7)
NasBert\NasBertTrainer.cs (1)
240
return
DataUtils
.CollateTokens(inputTensors, Tokenizer.RobertaModel().PadIndex, device: Device);
Roberta\Models\RobertaModel.cs (3)
116
var position = torch.tensor(
DataUtils
.Concat<int>(Positions.AsSpan(0, allSize), Zeros.AsSpan(0, size - allSize)),
119
torch.tensor(
DataUtils
.Concat<int>(Zeros.AsSpan(0, questionSize + 2), Ones.AsSpan(0, allSize - questionSize - 2), Zeros.AsSpan(0, size - allSize)),
121
var attentionMask = torch.tensor(
DataUtils
.Concat<int>(Zeros.AsSpan(0, allSize), NegBillionPad.AsSpan(0, size - allSize)),
Roberta\Modules\AttentionSelf.cs (2)
69
var contextShape =
DataUtils
.Concat<long>(contextLayer.shape.AsSpan(0, contextLayer.shape.Length - 2), NumAttentionHeads * AttentionHeadSize);
80
var newShape =
DataUtils
.Concat<long>(x.shape.AsSpan(0, x.shape.Length - 1), NumAttentionHeads, AttentionHeadSize);
Roberta\QATrainer.cs (1)
386
return
DataUtils
.CollateTokens(inputTensors, padIndex, device: Device);