Skip to content

Commit e4786b7

Browse files
committed
Tensor.Creation.CreateTensorFromNDArray: Fixed when passed ND is sliced.
1 parent 1272a60 commit e4786b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ private unsafe IntPtr CreateTensorFromNDArray(NDArray nd, TF_DataType? given_dty
520520
len: (UIntPtr) (nd.size * nd.dtypesize));
521521

522522
//if TF decided not to perform copy, hold reference for given NDArray.
523-
if (TF_TensorData(handle).ToPointer() == nd.Unsafe.Address)
523+
if (TF_TensorData(handle).ToPointer() == arraySlice.Address)
524524
{
525525
AllocationType = AllocationType.FromPointer;
526526
AllocationReferenceHolder = nd.Unsafe.Storage;

0 commit comments

Comments
 (0)