2 instantiations of Pair
Microsoft.ML.Tokenizers (2)
Model\BPETokenizer.cs (1)
293Merges.Add(new Pair<int>(aId, bId), (i, newId));
Model\Pair.cs (1)
16public static Pair<T> Create(T first, T second) => new Pair<T>(first, second);
20 references to Pair
Microsoft.ML.Tokenizers (20)
Model\BPETokenizer.cs (1)
792internal Dictionary<Pair<int>, (int, int)> Merges { get; }
Model\Pair.cs (5)
11internal struct Pair<T> : IEquatable<Pair<T>>, IComparable<Pair<T>> where T : struct, IEquatable<T>, IComparable<T> 16public static Pair<T> Create(T first, T second) => new Pair<T>(first, second); 24public bool Equals(Pair<T> other) => First.Equals(other.First) && Second.Equals(other.Second); 35public int CompareTo(Pair<T> other)
Model\Word.cs (14)
49public Vec<(Pair<int>, int)> Merge(int c1, int c2, int replacement) 51Vec<(Pair<int>, int)> changes = new(); 70changes.Push((Pair<int>.Create(_symbols[i - 1].C, first.C), -1)); 71changes.Push((Pair<int>.Create(_symbols[i - 1].C, replacement), 1)); 89changes.Push((Pair<int>.Create(second.C, _symbols[i + 1].C), -1)); 90changes.Push((Pair<int>.Create(replacement, _symbols[i + 1].C), 1)); 100public void MergeAll(Dictionary<Pair<int>, (int, int)> merges, float? dropout, ref PriorityQueue<Merge>? priorityQueue) 109if (merges.TryGetValue(Pair<int>.Create(_symbols[i].C, _symbols[i + 1].C), out (int m1, int m2) value)) 141Pair<int> targetNewPair = Pair<int>.Create(_symbols[top.Pos].C, right.C); 165Pair<int> newPair = Pair<int>.Create(prevSymbol.C, current.C); 178Pair<int> newPair = Pair<int>.Create(current.C, nextSymbol.C);