| @@ -54,6 +54,13 @@ namespace Tensorflow | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| /// <summary> | |||||
| /// Returns a context manager that specifies control dependencies. | |||||
| /// | |||||
| /// Use with the `with` keyword to specify that all operations constructed | |||||
| /// within the context should have control dependencies on | |||||
| /// `control_inputs`. | |||||
| /// </summary> | |||||
| public _ControlDependenciesController control_dependencies(ITensorOrOperation[] control_inputs) | public _ControlDependenciesController control_dependencies(ITensorOrOperation[] control_inputs) | ||||
| { | { | ||||
| if (control_inputs == null) | if (control_inputs == null) | ||||
| @@ -7,7 +7,26 @@ using System.Runtime.InteropServices; | |||||
| using System.Text; | using System.Text; | ||||
| namespace Tensorflow | namespace Tensorflow | ||||
| { | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents a graph node that performs computation on tensors. | |||||
| /// | |||||
| /// An `Operation` is a node in a TensorFlow `Graph` that takes zero or | |||||
| /// more `Tensor` objects as input, and produces zero or more `Tensor` | |||||
| /// objects as output. Objects of type `Operation` are created by | |||||
| /// calling an op constructor(such as `tf.matmul`) | |||||
| /// or `tf.Graph.create_op`. | |||||
| /// | |||||
| /// For example `c = tf.matmul(a, b)` creates an `Operation` of type | |||||
| /// "MatMul" that takes tensors `a` and `b` as input, and produces `c` | |||||
| /// as output. | |||||
| /// | |||||
| /// After the graph has been launched in a session, an `Operation` can | |||||
| /// be executed by passing it to | |||||
| /// `tf.Session.run`. | |||||
| /// `op.run()` is a shortcut for calling `tf.get_default_session().run(op)`. | |||||
| /// </summary> | |||||
| public partial class Operation : ITensorOrOperation | public partial class Operation : ITensorOrOperation | ||||
| { | { | ||||
| private readonly IntPtr _handle; // _c_op in python | private readonly IntPtr _handle; // _c_op in python | ||||
| @@ -4,8 +4,25 @@ using System.Text; | |||||
| namespace Tensorflow.Train | namespace Tensorflow.Train | ||||
| { | { | ||||
| /// <summary> | |||||
| /// Optimizer that implements the gradient descent algorithm. | |||||
| /// </summary> | |||||
| public class GradientDescentOptimizer : Optimizer | public class GradientDescentOptimizer : Optimizer | ||||
| { | |||||
| { | |||||
| /// <summary> | |||||
| /// Construct a new gradient descent optimizer. | |||||
| /// </summary> | |||||
| /// <param name="learning_rate">A Tensor or a floating point value. The learning | |||||
| /// rate to use.</param> | |||||
| /// <param name="use_locking">If true use locks for update operations.</param> | |||||
| /// <param name="name">Optional name prefix for the operations created when applying | |||||
| /// gradients.Defaults to "GradientDescent".</param> | |||||
| /// <remarks> | |||||
| /// When eager execution is enabled, `learning_rate` can be a callable that | |||||
| /// takes no arguments and returns the actual value to use.This can be useful | |||||
| /// for changing these values across different invocations of optimizer | |||||
| /// functions. | |||||
| /// </remarks> | |||||
| public GradientDescentOptimizer(float learning_rate, bool use_locking = false, string name = "GradientDescent") | public GradientDescentOptimizer(float learning_rate, bool use_locking = false, string name = "GradientDescent") | ||||
| : base(learning_rate, use_locking, name) | : base(learning_rate, use_locking, name) | ||||
| { | { | ||||
| @@ -98,12 +98,27 @@ namespace Tensorflow | |||||
| public static Tensor internal_convert_to_tensor_or_composite(Tensor value, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool as_ref = false) | public static Tensor internal_convert_to_tensor_or_composite(Tensor value, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool as_ref = false) | ||||
| { | { | ||||
| return internal_convert_to_tensor(value, dtype: dtype, name: name, as_ref: as_ref); | return internal_convert_to_tensor(value, dtype: dtype, name: name, as_ref: as_ref); | ||||
| } | |||||
| } | |||||
| /// <summary> | /// <summary> | ||||
| /// Wrapper for `Graph.control_dependencies()` using the default graph. | /// Wrapper for `Graph.control_dependencies()` using the default graph. | ||||
| /// | |||||
| /// See `tf.Graph.control_dependencies` for more details. | |||||
| /// When eager execution is enabled, any callable object in the `control_inputs` | |||||
| /// list will be called. | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="control_inputs"></param> | |||||
| /// <param name="control_inputs"> | |||||
| /// A list of `Operation` or `Tensor` objects which | |||||
| /// must be executed or computed before running the operations | |||||
| /// defined in the context.Can also be `None` to clear the control | |||||
| /// dependencies.If eager execution is enabled, any callable object in the | |||||
| /// `control_inputs` list will be called. | |||||
| /// </param> | |||||
| /// <returns> | |||||
| /// A context manager that specifies control dependencies for all | |||||
| /// operations constructed within the context. | |||||
| /// </returns> | |||||
| public static _ControlDependenciesController control_dependencies(Operation[] control_inputs) | public static _ControlDependenciesController control_dependencies(Operation[] control_inputs) | ||||
| { | { | ||||
| return get_default_graph().control_dependencies(control_inputs); | return get_default_graph().control_dependencies(control_inputs); | ||||