This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
Register
Sign In
scisharp
/
TensorFlow.NET
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
21
Wiki
evaluate
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
HPC
Browse Source
Fix RunInAutoMode.
tags/yolov3
Oceania2018
4 years ago
parent
77e6bb527a
commit
a7f95991a6
3 changed files
with
15 additions
and
9 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+13
-7
src/TensorFlowNET.Core/Contexts/Context.AutoMode.cs
+1
-1
src/TensorFlowNET.Core/Variables/BaseResourceVariable.cs
+1
-1
src/TensorFlowNET.Core/Variables/ResourceVariable.Implicit.cs
+ 13
- 7
src/TensorFlowNET.Core/Contexts/Context.AutoMode.cs
View File
@@ -32,19 +32,25 @@ namespace Tensorflow.Contexts
{
if (tf.Context.has_graph_arg(args))
{
return graphAction();
if (executing_eagerly())
{
graph_mode();
var result = graphAction();
restore_mode();
return result;
}
else
{
return graphAction();
}
}
else
{
try
if (
t
f.Context.executing_eage
r
l
y
())
{
return eagerAction();
}
catch (InvalidArgumentError ex)
{
throw ex;
}
catch (Exception ex)
else
{
return graphAction();
}
+ 1
- 1
src/TensorFlowNET.Core/Variables/BaseResourceVariable.cs
View File
@@ -162,7 +162,7 @@ namespace Tensorflow
/// read the value only after some condition is true.
/// </summary>
/// <returns></returns>
Tensor read_value()
protected
Tensor read_value()
=> tf_with(ops.name_scope("Read"), delegate
{
var value = _read_variable_op();
+ 1
- 1
src/TensorFlowNET.Core/Variables/ResourceVariable.Implicit.cs
View File
@@ -36,7 +36,7 @@ namespace Tensorflow
if (as_ref)
return handle;
else
return
AsTensor
();
return
GraphElement ?? read_value
();
}
}
}
Write
Preview
Loading…
Cancel
Save