|
|
@@ -58,9 +58,6 @@ namespace Tensorflow.Keras.Layers |
|
|
|
args.DType = args.InputTensor == null ? tf.float32 : args.InputTensor.dtype; |
|
|
|
} |
|
|
|
|
|
|
|
// In graph mode, create a graph placeholder to call the layer on. |
|
|
|
tf.Context.graph_mode(); |
|
|
|
|
|
|
|
if (args.InputTensor == null) |
|
|
|
{ |
|
|
|
if (args.InputShape != null) |
|
|
@@ -74,6 +71,9 @@ namespace Tensorflow.Keras.Layers |
|
|
|
args.BatchInputShape = null; |
|
|
|
} |
|
|
|
|
|
|
|
var graph = keras.backend.get_graph(); |
|
|
|
graph.as_default(); |
|
|
|
|
|
|
|
args.InputTensor = keras.backend.placeholder( |
|
|
|
shape: BatchInputShape, |
|
|
|
dtype: DType, |
|
|
@@ -81,8 +81,8 @@ namespace Tensorflow.Keras.Layers |
|
|
|
sparse: args.Sparse, |
|
|
|
ragged: args.Ragged); |
|
|
|
|
|
|
|
|
|
|
|
isPlaceholder = true; |
|
|
|
tf.Context.restore_mode(); |
|
|
|
} |
|
|
|
|
|
|
|
// Create an input node to add to self.outbound_node |
|
|
@@ -97,8 +97,6 @@ namespace Tensorflow.Keras.Layers |
|
|
|
typeSpec = new TensorSpec(args.InputTensor.TensorShape, |
|
|
|
dtype: args.InputTensor.dtype, |
|
|
|
name: Name); |
|
|
|
|
|
|
|
tf.Context.restore_mode(); |
|
|
|
} |
|
|
|
|
|
|
|
public static InputLayer from_config(LayerArgs args) |
|
|
|