Skip to content

Commit 792703d

Browse files
committed
fix part of conflits
1 parent 586dba5 commit 792703d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Microsoft.ML.Data/Transforms/Hashing.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ public uint HashCoreOld(uint seed, uint mask, in float value)
544544

545545
[MethodImpl(MethodImplOptions.AggressiveInlining)]
546546
public uint HashCore(uint seed, uint mask, in float value)
547-
=> float.IsNaN(value) ? 0 : (Hashing.MixHashV2(Hashing.MurmurRound(seed, FloatUtils.GetBits(value == 0 ? 0 : value)), sizeof(float)) & mask) + 1;
547+
=> float.IsNaN(value) ? 0 : (Hashing.MixHash(Hashing.MurmurRound(seed, FloatUtils.GetBits(value == 0 ? 0 : value)), sizeof(float)) & mask) + 1;
548548

549549
[MethodImpl(MethodImplOptions.AggressiveInlining)]
550550
public uint HashCore(uint seed, uint mask, in VBuffer<float> values)
@@ -1372,8 +1372,8 @@ private bool SaveAsOnnxCore(OnnxContext ctx, int iinfo, string srcVariable, stri
13721372
castNode.AddAttribute("to", NumberDataViewType.UInt32.RawType);
13731373
murmurNode = ctx.CreateNode(opType, castOutput, murmurOutput, ctx.GetNodeName(opType), "com.microsoft");
13741374
}
1375-
else if (srcType == NumberDataViewType.UInt32 || srcType == NumberDataViewType.Int32 || srcType == typeof(ulong) ||
1376-
srcType == typeof(long) || srcType == typeof(float) || srcType == typeof(double) || srcType == TextDataViewType.Instance)
1375+
else if (srcType == NumberDataViewType.UInt32 || srcType == NumberDataViewType.Int32 || srcType == NumberDataViewType.UInt64 ||
1376+
srcType == NumberDataViewType.Int64 || srcType == NumberDataViewType.Single || srcType == NumberDataViewType.Double || srcType == TextDataViewType.Instance)
13771377

13781378
{
13791379
murmurNode = ctx.CreateNode(opType, srcVariable, murmurOutput, ctx.GetNodeName(opType), "com.microsoft");

test/Microsoft.ML.Tests/Transformers/HashTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,6 @@ private void HashTestPositiveIntegerCore(ulong value, uint expected, uint expect
251251

252252
HashTestCore(new DataViewRowId(value, 0), RowIdDataViewType.Instance, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse);
253253

254-
//This test calls HashKey8V2 which implemented the same way as 32bit
255-
HashTestCore((ulong)value, new KeyDataViewType(typeof(ulong), ulong.MaxValue - 1), eKey, eoKey, e3Key);
256-
257254
// Next let's check signed numbers.
258255

259256
if (value <= (ulong)sbyte.MaxValue)

0 commit comments

Comments
 (0)