Skip to content

Commit c2c2ac6

Browse files
committed
check NearestNeighbors op
1 parent 0484aab commit c2c2ac6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎test/TensorFlowNET.UnitTest/OperationsTest.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.VisualStudio.TestTools.UnitTesting;
22
using System;
33
using System.Collections.Generic;
4+
using System.Linq;
45
using System.Text;
56
using Tensorflow;
67
using Buffer = Tensorflow.Buffer;
@@ -20,6 +21,13 @@ public void GetAllOpList()
2021
var handle = c_api.TF_GetAllOpList();
2122
var buffer = new Buffer(handle);
2223
var op_list = OpList.Parser.ParseFrom(buffer);
24+
25+
var _registered_ops = new Dictionary<string, OpDef>();
26+
foreach (var op_def in op_list.Op)
27+
_registered_ops[op_def.Name] = op_def;
28+
29+
// r1.14 added NN op
30+
var op = _registered_ops.FirstOrDefault(x => x.Key == "NearestNeighbors");
2331
Assert.IsTrue(op_list.Op.Count > 1000);
2432
}
2533

0 commit comments

Comments
 (0)