From 098f597e32aefd90ba9220087c5602df332d7ac3 Mon Sep 17 00:00:00 2001 From: Brendan Mulcahy Date: Sun, 18 Aug 2019 13:44:06 -0400 Subject: [PATCH 1/2] Add tf.nn.in_top_k --- src/TensorFlowNET.Core/APIs/tf.nn.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.nn.cs b/src/TensorFlowNET.Core/APIs/tf.nn.cs index 67efe726..7b60d93d 100644 --- a/src/TensorFlowNET.Core/APIs/tf.nn.cs +++ b/src/TensorFlowNET.Core/APIs/tf.nn.cs @@ -131,6 +131,8 @@ namespace Tensorflow public static Tensor max_pool(Tensor value, int[] ksize, int[] strides, string padding, string data_format = "NHWC", string name = null) => nn_ops.max_pool(value, ksize, strides, padding, data_format: data_format, name: name); + public static Tensor in_top_k(Tensor predictions, Tensor targets, int k, string name = "InTopK") => gen_ops.in_top_k(predictions, targets, k, name); + public static Tensor[] top_k(Tensor input, int k = 1, bool sorted = true, string name = null) => gen_nn_ops.top_kv2(input, k: k, sorted: sorted, name: name); From babfb020e76427f0a340ed85b30f8e01f8123b8e Mon Sep 17 00:00:00 2001 From: Brendan Mulcahy Date: Sun, 18 Aug 2019 14:03:16 -0400 Subject: [PATCH 2/2] New line for better consistency --- src/TensorFlowNET.Core/APIs/tf.nn.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.nn.cs b/src/TensorFlowNET.Core/APIs/tf.nn.cs index 7b60d93d..8a631c05 100644 --- a/src/TensorFlowNET.Core/APIs/tf.nn.cs +++ b/src/TensorFlowNET.Core/APIs/tf.nn.cs @@ -131,7 +131,8 @@ namespace Tensorflow public static Tensor max_pool(Tensor value, int[] ksize, int[] strides, string padding, string data_format = "NHWC", string name = null) => nn_ops.max_pool(value, ksize, strides, padding, data_format: data_format, name: name); - public static Tensor in_top_k(Tensor predictions, Tensor targets, int k, string name = "InTopK") => gen_ops.in_top_k(predictions, targets, k, name); + public static Tensor in_top_k(Tensor predictions, Tensor targets, int k, string name = "InTopK") + => gen_ops.in_top_k(predictions, targets, k, name); public static Tensor[] top_k(Tensor input, int k = 1, bool sorted = true, string name = null) => gen_nn_ops.top_kv2(input, k: k, sorted: sorted, name: name);