5 writes to Weight
Microsoft.ML.TorchSharp (5)
NasBert\Modules\Embedding\SinusoidalPositionalEmbedding.cs (5)
23
Weight
= GetEmbedding(numEmbeddings, embeddingDim);
80
Weight
= GetEmbedding(maxPosition, EmbeddingDim);
81
Weight
= (Parameter)Weight.MoveToOuterDisposeScope();
89
Weight
= (Parameter)Weight.to(buffer);
90
Weight
= (Parameter)Weight.MoveToOuterDisposeScope();
9 references to Weight
Microsoft.ML.TorchSharp (9)
NasBert\Modules\Embedding\SinusoidalPositionalEmbedding.cs (9)
77
if (
Weight
is null || maxPosition >
Weight
.size(0))
79
Weight
?.Dispose();
81
Weight = (Parameter)
Weight
.MoveToOuterDisposeScope();
89
Weight = (Parameter)
Weight
.to(buffer);
90
Weight = (Parameter)
Weight
.MoveToOuterDisposeScope();
101
var slice =
Weight
[torch.TensorIndex.Single(PadPositionIndex + pos), torch.TensorIndex.Colon];
106
var weightsSelected =
Weight
.index_select(0, positions).view(bszInt, seqLenInt, -1);
127
Weight
.Dispose();