@@ -71,38 +71,7 @@ public partial class c_api
7171 /// <param name="deallocator_arg"></param>
7272 /// <returns></returns>
7373 [ DllImport ( TensorFlowLibName ) ]
74- public static extern IntPtr TF_NewTensor ( TF_DataType dataType , long [ ] dims , int num_dims , IntPtr data , UIntPtr len , Deallocator deallocator , ref DeallocatorArgs deallocator_arg ) ;
75-
76- [ DllImport ( TensorFlowLibName ) ]
77- public static extern TF_Tensor TF_NewTensor ( TF_DataType dataType , long [ ] dims , int num_dims , IntPtr data , long len , DeallocatorV2 deallocator , IntPtr args ) ;
78-
79- /// <summary>
80- /// Return a new tensor that holds the bytes data[0,len-1]
81- /// </summary>
82- /// <param name="dataType"></param>
83- /// <param name="dims"></param>
84- /// <param name="num_dims"></param>
85- /// <param name="data"></param>
86- /// <param name="len">num_bytes, ex: 6 * sizeof(float)</param>
87- /// <param name="deallocator"></param>
88- /// <param name="deallocator_arg"></param>
89- /// <returns></returns>
90- [ DllImport ( TensorFlowLibName ) ]
91- public static extern IntPtr TF_NewTensor ( TF_DataType dataType , long [ ] dims , int num_dims , IntPtr data , ulong len , Deallocator deallocator , IntPtr deallocator_arg ) ;
92-
93- /// <summary>
94- /// Return a new tensor that holds the bytes data[0,len-1]
95- /// </summary>
96- /// <param name="dataType"></param>
97- /// <param name="dims"></param>
98- /// <param name="num_dims"></param>
99- /// <param name="data"></param>
100- /// <param name="len">num_bytes, ex: 6 * sizeof(float)</param>
101- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
102- public static unsafe IntPtr TF_NewTensor ( TF_DataType dataType , long [ ] dims , int num_dims , IntPtr data , ulong len )
103- {
104- return TF_NewTensor ( dataType , dims , num_dims , data , len , EmptyDeallocator , DeallocatorArgs . Empty ) ;
105- }
74+ public static extern SafeTensorHandle TF_NewTensor ( TF_DataType dataType , long [ ] dims , int num_dims , IntPtr data , ulong len , Deallocator deallocator , IntPtr deallocator_arg ) ;
10675
10776 public static unsafe SafeTensorHandle TF_NewTensor ( byte [ ] data , Shape shape , TF_DataType dtype )
10877 {
@@ -137,20 +106,6 @@ public static unsafe SafeTensorHandle TF_NewTensor<T>(T value)
137106 return handle ;
138107 }
139108
140- /// <summary>
141- /// Return a new tensor that holds the bytes data[0,len-1]
142- /// </summary>
143- /// <param name="dataType"></param>
144- /// <param name="dims"></param>
145- /// <param name="num_dims"></param>
146- /// <param name="data"></param>
147- /// <param name="len">num_bytes, ex: 6 * sizeof(float)</param>
148- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
149- public static unsafe IntPtr TF_NewTensor ( TF_DataType dataType , long [ ] dims , int num_dims , void * data , ulong len )
150- {
151- return TF_NewTensor ( dataType , dims , num_dims , new IntPtr ( data ) , len ) ;
152- }
153-
154109 /// <summary>
155110 /// Return the number of dimensions that the tensor has.
156111 /// </summary>
0 commit comments