1 write to _embeddingDim
Microsoft.ML.TorchSharp (1)
NasBert\Modules\MultiHeadAttention.cs (1)
66
_embeddingDim
= embeddingDim;
13 references to _embeddingDim
Microsoft.ML.TorchSharp (13)
NasBert\Modules\MultiHeadAttention.cs (13)
69
_qkvSameDim = (_kDim ==
_embeddingDim
) && (_vDim ==
_embeddingDim
);
73
_headDim =
_embeddingDim
/ _numHeads;
75
if (_headDim * _numHeads !=
_embeddingDim
)
91
QProjection = torch.nn.Linear(
_embeddingDim
,
_embeddingDim
, _addBiasProj);
92
KProjection = torch.nn.Linear(_kDim,
_embeddingDim
, _addBiasProj);
93
VProjection = torch.nn.Linear(_vDim,
_embeddingDim
, _addBiasProj);
97
KBias = torch.zeros(1, 1,
_embeddingDim
).AsParameter();
98
VBias = torch.zeros(1, 1,
_embeddingDim
).AsParameter();
101
OutProjLinear = torch.nn.Linear(
_embeddingDim
,
_embeddingDim
, _addBiasProj);
162
if (query.IsNull() || query.size().Length != 3 || query.size(2) !=
_embeddingDim
)