1 write to AttentionHeadSize
Microsoft.ML.TorchSharp (1)
Roberta\Modules\AttentionSelf.cs (1)
31AttentionHeadSize = (int)hiddenSize / numAttentionHeads;
4 references to AttentionHeadSize
Microsoft.ML.TorchSharp (4)
Roberta\Modules\AttentionSelf.cs (4)
32if (NumAttentionHeads * AttentionHeadSize != hiddenSize) 57queryLayer.div_(Math.Sqrt(AttentionHeadSize)); 69var contextShape = DataUtils.Concat<long>(contextLayer.shape.AsSpan(0, contextLayer.shape.Length - 2), NumAttentionHeads * AttentionHeadSize); 80var newShape = DataUtils.Concat<long>(x.shape.AsSpan(0, x.shape.Length - 1), NumAttentionHeads, AttentionHeadSize);