@@ -166,7 +166,6 @@ namespace Tensorflow | |||||
} | } | ||||
[DebuggerStepThrough] | [DebuggerStepThrough] | ||||
[DebuggerNonUserCode()] // with "Just My Code" enabled this lets the debugger break at the origin of the exception | |||||
public static void tf_with(ITensorFlowObject py, Action<ITensorFlowObject> action) | public static void tf_with(ITensorFlowObject py, Action<ITensorFlowObject> action) | ||||
{ | { | ||||
try | try | ||||
@@ -181,8 +180,7 @@ namespace Tensorflow | |||||
} | } | ||||
} | } | ||||
[DebuggerStepThrough] | |||||
[DebuggerNonUserCode()] // with "Just My Code" enabled this lets the debugger break at the origin of the exception | |||||
// [DebuggerStepThrough] | |||||
public static void tf_with<T>(T py, Action<T> action) where T : ITensorFlowObject | public static void tf_with<T>(T py, Action<T> action) where T : ITensorFlowObject | ||||
{ | { | ||||
try | try | ||||
@@ -198,7 +196,6 @@ namespace Tensorflow | |||||
} | } | ||||
[DebuggerStepThrough] | [DebuggerStepThrough] | ||||
[DebuggerNonUserCode()] // with "Just My Code" enabled this lets the debugger break at the origin of the exception | |||||
public static TOut tf_with<TIn, TOut>(TIn py, Func<TIn, TOut> action) where TIn : ITensorFlowObject | public static TOut tf_with<TIn, TOut>(TIn py, Func<TIn, TOut> action) where TIn : ITensorFlowObject | ||||
{ | { | ||||
try | try | ||||
@@ -87,9 +87,9 @@ namespace Tensorflow | |||||
if (trainable && !collections.Contains(tf.GraphKeys.TRAINABLE_VARIABLES)) | if (trainable && !collections.Contains(tf.GraphKeys.TRAINABLE_VARIABLES)) | ||||
collections.Add(tf.GraphKeys.TRAINABLE_VARIABLES); | collections.Add(tf.GraphKeys.TRAINABLE_VARIABLES); | ||||
_in_graph_mode = !tf.Context.executing_eagerly(); | |||||
tf_with(ops.init_scope(), init_scope => | tf_with(ops.init_scope(), init_scope => | ||||
{ | { | ||||
_in_graph_mode = !tf.Context.executing_eagerly(); | |||||
var values = init_from_fn ? new object[0] : new object[] { initial_value }; | var values = init_from_fn ? new object[0] : new object[] { initial_value }; | ||||
tf_with(ops.name_scope(name, "Variable", values, skip_on_eager: false), scope => | tf_with(ops.name_scope(name, "Variable", values, skip_on_eager: false), scope => | ||||
{ | { | ||||
@@ -296,6 +296,7 @@ namespace Tensorflow | |||||
// outer_device_stack = None | // outer_device_stack = None | ||||
}); | }); | ||||
tf.Context.ScopeName = scope; | |||||
return ops.name_scope(scope); | return ops.name_scope(scope); | ||||
} | } | ||||
@@ -48,7 +48,7 @@ namespace Tensorflow | |||||
_skip_on_eager = skip_on_eager; | _skip_on_eager = skip_on_eager; | ||||
} | } | ||||
// [DebuggerStepThrough] | |||||
[DebuggerStepThrough] | |||||
public void __enter__() | public void __enter__() | ||||
{ | { | ||||
if (tf.Context.executing_eagerly()) | if (tf.Context.executing_eagerly()) | ||||
@@ -96,7 +96,7 @@ namespace Tensorflow | |||||
return (scope_name, old_name); | return (scope_name, old_name); | ||||
} | } | ||||
[DebuggerHidden] | |||||
[DebuggerStepThrough] | |||||
public void Dispose() | public void Dispose() | ||||
{ | { | ||||
if (tf.Context.executing_eagerly()) | if (tf.Context.executing_eagerly()) | ||||
@@ -105,7 +105,7 @@ namespace Tensorflow | |||||
get_default_graph()._name_stack = old_scope_name; | get_default_graph()._name_stack = old_scope_name; | ||||
} | } | ||||
[DebuggerNonUserCode] | |||||
[DebuggerStepThrough] | |||||
public void __exit__() | public void __exit__() | ||||
{ | { | ||||
} | } | ||||