|
@@ -52,9 +52,9 @@ namespace Tensorflow |
|
|
private DeallocatorArgs _deallocatorArgs = new DeallocatorArgs() { gc_handle = IntPtr.Zero }; |
|
|
private DeallocatorArgs _deallocatorArgs = new DeallocatorArgs() { gc_handle = IntPtr.Zero }; |
|
|
|
|
|
|
|
|
// note: they must be assigned to a static variable in order to work as unmanaged callbacks |
|
|
// note: they must be assigned to a static variable in order to work as unmanaged callbacks |
|
|
static Deallocator _hGlobalDeallocator = FreeHGlobalMemory; |
|
|
|
|
|
static Deallocator _gcHandleDeallocator = FreeGCHandle; |
|
|
|
|
|
private static Deallocator _nothingDeallocator = FreeNothing; |
|
|
|
|
|
|
|
|
private static readonly Deallocator _hGlobalDeallocator = FreeHGlobalMemory; |
|
|
|
|
|
private static readonly Deallocator _gcHandleDeallocator = FreeGCHandle; |
|
|
|
|
|
private static readonly Deallocator _nothingDeallocator = FreeNothing; |
|
|
|
|
|
|
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// Create a Tensor object from an existing TF handle |
|
|
/// Create a Tensor object from an existing TF handle |
|
@@ -624,7 +624,7 @@ namespace Tensorflow |
|
|
Marshal.WriteInt64(tensor, 0); |
|
|
Marshal.WriteInt64(tensor, 0); |
|
|
|
|
|
|
|
|
var status = new Status(); |
|
|
var status = new Status(); |
|
|
fixed (byte* src = &buffer[0]) |
|
|
|
|
|
|
|
|
fixed (byte* src = buffer) |
|
|
c_api.TF_StringEncode(src, (UIntPtr)buffer.Length, (sbyte*)(tensor + sizeof(Int64)), size, status); |
|
|
c_api.TF_StringEncode(src, (UIntPtr)buffer.Length, (sbyte*)(tensor + sizeof(Int64)), size, status); |
|
|
|
|
|
|
|
|
status.Check(true); |
|
|
status.Check(true); |
|
|