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