From 7293c328f7ab81ae4eca705289de92cda7d36f7e Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Sun, 20 Dec 2020 18:52:31 -0600 Subject: [PATCH] ConcatV2 should be recorded #701 --- .../Eager/EagerRunner.TFE_FastPathExecute.cs | 6 ++++-- src/TensorFlowNET.Keras/Layers/Reshaping/Reshape.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs b/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs index 5fe058e2..1903e5cd 100644 --- a/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs +++ b/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs @@ -380,8 +380,10 @@ namespace Tensorflow.Eager c_api.TFE_OpSetAttrBool(op, key, Convert.ToBoolean(value)); break; case TF_AttrType.TF_ATTR_INT: - attr_list_sizes[key] = Convert.ToInt64(value); - c_api.TFE_OpSetAttrInt(op, key, attr_list_sizes[key]); + var size = Convert.ToInt64(value); + c_api.TFE_OpSetAttrInt(op, key, size); + if (attr_list_sizes != null) + attr_list_sizes[key] = size; break; case TF_AttrType.TF_ATTR_FLOAT: c_api.TFE_OpSetAttrFloat(op, key, Convert.ToSingle(value)); diff --git a/src/TensorFlowNET.Keras/Layers/Reshaping/Reshape.cs b/src/TensorFlowNET.Keras/Layers/Reshaping/Reshape.cs index dcf27c24..dce2013c 100644 --- a/src/TensorFlowNET.Keras/Layers/Reshaping/Reshape.cs +++ b/src/TensorFlowNET.Keras/Layers/Reshaping/Reshape.cs @@ -22,7 +22,7 @@ namespace Tensorflow.Keras.Layers protected override Tensors Call(Tensors inputs, Tensor state = null, bool is_training = false) { var shape_tensor = array_ops.shape(inputs); - var shape = new List { shape_tensor.shape[0] }; + var shape = new List { inputs.shape[0] }; shape.AddRange(args.TargetShape.dims); var result = array_ops.reshape(inputs, shape.ToArray());