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