From 56928f049b876c111f4a3aa245ba1ee5324b5fb7 Mon Sep 17 00:00:00 2001 From: Samuel Caldas Date: Thu, 21 May 2020 23:13:05 -0300 Subject: [PATCH] Exposing categorical random --- src/TensorFlowNET.Core/APIs/tf.random.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.random.cs b/src/TensorFlowNET.Core/APIs/tf.random.cs index d6c7d93a..54fd57be 100644 --- a/src/TensorFlowNET.Core/APIs/tf.random.cs +++ b/src/TensorFlowNET.Core/APIs/tf.random.cs @@ -38,6 +38,12 @@ namespace Tensorflow TF_DataType dtype = TF_DataType.TF_FLOAT, int? seed = null, string name = null) => random_ops.random_normal(shape, mean, stddev, dtype, seed, name); + public Tensor categorical( + Tensor logits, + int num_samples, + int? seed = null, + string name = null, + TF_DataType output_dtype = TF_DataType.DtInvalid) => random_ops.multinomial(logits, num_samples, seed: seed, name: name, output_dtype: output_dtype); } public Tensor random_uniform(TensorShape shape,