From e4786b7d1cd63ca72e99a22bf10c19c0ac397e51 Mon Sep 17 00:00:00 2001 From: Eli Belash Date: Sat, 31 Aug 2019 15:44:49 +0300 Subject: [PATCH] Tensor.Creation.CreateTensorFromNDArray: Fixed when passed ND is sliced. --- src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs index b1c0be1d..003a7fd9 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs @@ -520,7 +520,7 @@ namespace Tensorflow len: (UIntPtr) (nd.size * nd.dtypesize)); //if TF decided not to perform copy, hold reference for given NDArray. - if (TF_TensorData(handle).ToPointer() == nd.Unsafe.Address) + if (TF_TensorData(handle).ToPointer() == arraySlice.Address) { AllocationType = AllocationType.FromPointer; AllocationReferenceHolder = nd.Unsafe.Storage;