8 references to PadPositionIndex
Microsoft.ML.TorchSharp (8)
NasBert\Modules\Embedding\LearnedPositionalEmbedding.cs (3)
26
Embedding = torch.nn.Embedding(numEmbeddings, embeddingDim,
PadPositionIndex
);
29
ModelUtils.InitZeros(Embedding.weight[
PadPositionIndex
]);
49
? torch.tensor(
PadPositionIndex
+ input.size(1))
NasBert\Modules\Embedding\PositionalEmbedding.cs (2)
42
numEmbeddings += (
PadPositionIndex
+ 1) + 1;
59
positions.add_(
PadPositionIndex
);
NasBert\Modules\Embedding\SinusoidalPositionalEmbedding.cs (3)
54
embedding[
PadPositionIndex
, torch.TensorIndex.Colon].fill_(0);
74
var maxPosition = (int)(
PadPositionIndex
+ 1 + input.shape[1]);
101
var slice = Weight[torch.TensorIndex.Single(
PadPositionIndex
+ pos), torch.TensorIndex.Colon];