Browse Source

remove output for assign_add_variable_op.

tags/v0.20
Oceania2018 5 years ago
parent
commit
784b1ebee9
4 changed files with 12 additions and 14 deletions
  1. +2
    -1
      src/TensorFlowNET.Core/Eager/EagerTensor.Creation.cs
  2. +3
    -5
      src/TensorFlowNET.Core/Operations/gen_resource_variable_ops.cs
  3. +5
    -5
      src/TensorFlowNET.Core/System/GarbageCollector.cs
  4. +2
    -3
      src/TensorFlowNET.Core/Training/gen_training_ops.cs

+ 2
- 1
src/TensorFlowNET.Core/Eager/EagerTensor.Creation.cs View File

@@ -62,7 +62,8 @@ namespace Tensorflow.Eager
GarbageCollector.Decrease(tfe_tensor_handle);
GarbageCollector.Decrease(EagerTensorHandle);

/*c_api.TF_DeleteTensor(_handle);
/*print($"deleting DeleteTensorHandle {Id} {_handle.ToString("x16")}");
c_api.TF_DeleteTensor(_handle);
print($"deleting DeleteTensorHandle {Id} {tfe_tensor_handle.ToString("x16")}");
c_api.TFE_DeleteTensorHandle(tfe_tensor_handle);
print($"deleting DeleteEagerTensor {Id} {EagerTensorHandle.ToString("x16")}");


+ 3
- 5
src/TensorFlowNET.Core/Operations/gen_resource_variable_ops.cs View File

@@ -56,7 +56,6 @@ namespace Tensorflow
{
if (tf.context.executing_eagerly())
{
var results = new[] { new EagerTensor() };
Status status = c_api.TFE_FastPathExecute(tf.context, tf.context.device_name,
"AssignAddVariableOp", name,
new IntPtr[]
@@ -64,9 +63,9 @@ namespace Tensorflow
resource as EagerTensor,
value as EagerTensor
}, 2, null,
results.Select(x => x.EagerTensorHandle).ToArray(), results.Length);
null, 0);
status.Check(true);
return results[0].Resolve();
return null;
}

return null;
@@ -76,7 +75,6 @@ namespace Tensorflow
{
if (tf.context.executing_eagerly())
{
var results = new EagerTensor[0];
Status status = c_api.TFE_FastPathExecute(tf.context, tf.context.device_name,
"AssignVariableOp", name,
new IntPtr[]
@@ -84,7 +82,7 @@ namespace Tensorflow
resource as EagerTensor,
value as EagerTensor
}, 2, null,
results.Select(x => x.EagerTensorHandle).ToArray(), results.Length);
null, 0);
status.Check(true);
return null;
}


+ 5
- 5
src/TensorFlowNET.Core/System/GarbageCollector.cs View File

@@ -29,6 +29,9 @@ namespace Tensorflow

public static void Increase(IntPtr handle, GCItemType type)
{
if (handle == IntPtr.Zero)
return;

if (container.ContainsKey(handle))
{
container[handle].RefCounter++;
@@ -51,11 +54,8 @@ namespace Tensorflow

public static void Decrease(IntPtr handle)
{
lock (locker)
{
if (container.ContainsKey(handle))
container[handle].RefCounter--;
}
if (handle != IntPtr.Zero && container.ContainsKey(handle))
container[handle].RefCounter--;
}

private static void Recycle()


src/TensorFlowNET.Core/Training/gen_training_ops.py.cs → src/TensorFlowNET.Core/Training/gen_training_ops.cs View File

@@ -65,7 +65,6 @@ namespace Tensorflow
{
if (tf.context.executing_eagerly())
{
var results = new[] { new EagerTensor() };
Status status = c_api.TFE_FastPathExecute(tf.context, tf.context.device_name,
"ResourceApplyGradientDescent", name, new IntPtr[]
{
@@ -74,9 +73,9 @@ namespace Tensorflow
delta
}, 3,
op => wrap_tfe_src.SetOpAttrs(op, "use_locking", use_locking),
results.Select(x => x.EagerTensorHandle).ToArray(), results.Length);
null, 0);
status.Check(true);
return results[0].Resolve();
return null;
}

var _op = _op_def_lib._apply_op_helper("ResourceApplyGradientDescent", name, new

Loading…
Cancel
Save