From 210bc8916e7b740e83f7ae18ea8867f83cdf5a28 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Tue, 20 Aug 2019 21:14:24 -0500 Subject: [PATCH] trainable_variables #359 --- src/TensorFlowNET.Core/APIs/tf.variable.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.variable.cs b/src/TensorFlowNET.Core/APIs/tf.variable.cs index e855535a..8e905b1d 100644 --- a/src/TensorFlowNET.Core/APIs/tf.variable.cs +++ b/src/TensorFlowNET.Core/APIs/tf.variable.cs @@ -32,6 +32,14 @@ namespace Tensorflow return variables.variables_initializer(g.ToArray()); } + /// + /// Returns all variables created with `trainable=True`. + /// + /// + /// + public VariableV1[] trainable_variables(string scope = null) + => (variables.trainable_variables() as List).ToArray(); + public RefVariable get_variable(string name, TensorShape shape = null, TF_DataType dtype = TF_DataType.DtInvalid,