Browse Source

Tensor.Creation.CreateTensorFromNDArray: Fixed when passed ND is sliced.

tags/v0.12
Eli Belash 6 years ago
parent
commit
e4786b7d1c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs

+ 1
- 1
src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs View File

@@ -520,7 +520,7 @@ namespace Tensorflow
len: (UIntPtr) (nd.size * nd.dtypesize)); len: (UIntPtr) (nd.size * nd.dtypesize));


//if TF decided not to perform copy, hold reference for given NDArray. //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; AllocationType = AllocationType.FromPointer;
AllocationReferenceHolder = nd.Unsafe.Storage; AllocationReferenceHolder = nd.Unsafe.Storage;


Loading…
Cancel
Save