1 write to AttentionMask
Microsoft.ML.GenAI.Core (1)
Pipeline\CausalLMModelInput.cs (1)
34this.AttentionMask = attentionMask;
10 references to AttentionMask
Microsoft.ML.GenAI.Core (2)
Trainer\CasualLMSupervisedFineTuningTrainer.cs (2)
55var attentionMask = torch.cat(batch.Select(x => nn.functional.pad(x.AttentionMask!, [0, maxLen - x.AttentionMask!.shape[1]])).ToArray(), 0).to(device);
Microsoft.ML.GenAI.Core.Tests (4)
CasualLMDatasetTest.cs (4)
48dataset[0].AttentionMask!.data<long>().Should().BeEquivalentTo([1, 1, 1, 1, 1]); 49dataset[^1].AttentionMask!.data<long>().Should().BeEquivalentTo([1, 1, 1, 1, 1, 1, 1, 1, 1]); 51dataset[^1].AttentionMask!.data<long>().Should().BeEquivalentTo([1, 1, 1, 1, 1, 1, 1, 1, 1]); 75item.AttentionMask!.shape.Should().BeEquivalentTo(item.InputIds!.shape);
Microsoft.ML.GenAI.LLaMA (1)
Module\LlamaModel.cs (1)
67var attentionMask = input.AttentionMask;
Microsoft.ML.GenAI.Mistral (1)
MistralModel.cs (1)
61var attentionMask = input.AttentionMask;
Microsoft.ML.GenAI.Phi (2)
Module\Phi3Model.cs (1)
64var attentionMask = input.AttentionMask;
Phi2\Phi2ForCasualLM.cs (1)
37var attentionMask = input.AttentionMask;