Browse Source

Check if callContext is null or callContext.Value is null create a new ThreadLocal with CallContext.

tags/TimeSeries
vshakhlin Haiping 3 years ago
parent
commit
0e13a3a05d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/TensorFlowNET.Keras/Engine/Layer.Apply.cs

+ 1
- 1
src/TensorFlowNET.Keras/Engine/Layer.Apply.cs View File

@@ -14,7 +14,7 @@ namespace Tensorflow.Keras.Engine
/// <returns></returns> /// <returns></returns>
public Tensors Apply(Tensors inputs, Tensor state = null, bool training = false) public Tensors Apply(Tensors inputs, Tensor state = null, bool training = false)
{ {
callContext = callContext ?? new ThreadLocal<CallContext>()
callContext = callContext?.Value != null ? callContext : new ThreadLocal<CallContext>()
{ {
Value = new CallContext() Value = new CallContext()
}; };


Loading…
Cancel
Save