| @@ -26,7 +26,7 @@ Install TensorFlow.NET through NuGet. | |||||
| PM> Install-Package TensorFlow.NET | PM> Install-Package TensorFlow.NET | ||||
| ``` | ``` | ||||
| If you are using Linux or Mac OS, please download the pre-compiled dll [here](tensorflow.so) and place it in the working folder. This is only need for Linux and Mac OS, and already packed into NuGet for Windows. | |||||
| If you are using Linux or Mac OS, please download the pre-compiled dll [here](tensorflowlib) and place it in the working folder. This is only need for Linux and Mac OS, and already packed into NuGet for Windows. | |||||
| Import tensorflow.net. | Import tensorflow.net. | ||||
| @@ -8,5 +8,16 @@ namespace Tensorflow | |||||
| { | { | ||||
| public static object get_collection(string key, string scope = "") => get_default_graph() | public static object get_collection(string key, string scope = "") => get_default_graph() | ||||
| .get_collection(key, scope: scope); | .get_collection(key, scope: scope); | ||||
| /// <summary> | |||||
| /// Returns a context manager that creates hierarchical names for operations. | |||||
| /// </summary> | |||||
| /// <param name="name">The name argument that is passed to the op function.</param> | |||||
| /// <param name="default_name">The default name to use if the name argument is None.</param> | |||||
| /// <param name="values">The list of Tensor arguments that are passed to the op function.</param> | |||||
| /// <returns>The scope name.</returns> | |||||
| public static ops.name_scope name_scope(string name, | |||||
| string default_name = "", | |||||
| object values = null) => new ops.name_scope(name, default_name, values); | |||||
| } | } | ||||
| } | } | ||||
| @@ -17,7 +17,7 @@ namespace Tensorflow | |||||
| private static Tensor op_helper<T>(string default_name, RefVariable x, T y) | private static Tensor op_helper<T>(string default_name, RefVariable x, T y) | ||||
| { | { | ||||
| var tensor1 = x.value(); | var tensor1 = x.value(); | ||||
| return Python.with<ops.name_scope, Tensor>(new ops.name_scope(null, default_name, new object[] { tensor1, y }), scope => { | |||||
| return with<ops.name_scope, Tensor>(new ops.name_scope(null, default_name, new { tensor1, y }), scope => { | |||||
| var tensor2 = ops.convert_to_tensor(y, tensor1.dtype.as_base_dtype(), "y"); | var tensor2 = ops.convert_to_tensor(y, tensor1.dtype.as_base_dtype(), "y"); | ||||
| return gen_math_ops.add(tensor1, tensor2, scope); | return gen_math_ops.add(tensor1, tensor2, scope); | ||||
| }); | }); | ||||
| @@ -14,7 +14,7 @@ namespace Tensorflow | |||||
| /// the variable are fixed. The value can be changed using one of the assign methods. | /// the variable are fixed. The value can be changed using one of the assign methods. | ||||
| /// https://tensorflow.org/guide/variables | /// https://tensorflow.org/guide/variables | ||||
| /// </summary> | /// </summary> | ||||
| public class VariableV1 | |||||
| public class VariableV1 : Python | |||||
| { | { | ||||
| public VariableV1(object initial_value = null, | public VariableV1(object initial_value = null, | ||||
| bool trainable = true, | bool trainable = true, | ||||
| @@ -7,6 +7,9 @@ namespace Tensorflow | |||||
| { | { | ||||
| public partial class ops | public partial class ops | ||||
| { | { | ||||
| /// <summary> | |||||
| /// Returns a context manager that creates hierarchical names for operations. | |||||
| /// </summary> | |||||
| public class name_scope : IPython | public class name_scope : IPython | ||||
| { | { | ||||
| public string _name; | public string _name; | ||||