public static extern bool TF_TryEvaluateConstant(IntPtr graph, TF_Output output, IntPtr[] result, SafeStatusHandle status);
Exemple #2
0
 public static extern int TFE_OpGetOutputLength(SafeOpHandle op, string input_name, SafeStatusHandle status);
Exemple #3
0
 public static extern SafeContextHandle TFE_NewContext(SafeContextOptionsHandle opts, SafeStatusHandle status);
Exemple #4
0
 public static extern IntPtr TFE_TensorHandleBackingDeviceName(SafeTensorHandleHandle h, SafeStatusHandle status);
Exemple #5
0
 public static extern TF_AttrType TFE_OpNameGetAttrType(SafeContextHandle ctx, string op_or_function_name, string attr_name, ref byte is_list, SafeStatusHandle status);
Exemple #6
0
 public static extern IntPtr TFE_TensorHandleResolve(SafeTensorHandleHandle h, SafeStatusHandle status);
Exemple #7
0
 public static extern int TFE_TensorHandleDim(SafeTensorHandleHandle h, int dim, SafeStatusHandle status);
Exemple #8
0
 public static extern void TFE_ContextRemoveFunction(SafeContextHandle ctx, string name, SafeStatusHandle status);
Exemple #9
0
 /// <summary>
 /// Execute the operation defined by <paramref name="op"/> and return handles to computed
 /// tensors in <paramref name="retvals"/>.
 /// </summary>
 /// <remarks>
 /// Upon successful return, the first <paramref name="num_retvals"/> slots in <paramref name="retvals"/> will
 /// contain handle instances which the caller is responsible for disposing once they are no longer in use.
 /// </remarks>
 /// <param name="op"></param>
 /// <param name="retvals"></param>
 /// <param name="num_retvals"></param>
 /// <param name="status"></param>
 public static void TFE_Execute(SafeOpHandle op, SafeTensorHandleHandle[] retvals, out int num_retvals, SafeStatusHandle status)
 {
     unsafe
     {
         num_retvals = retvals?.Length ?? 0;
         var rawReturns = stackalloc IntPtr[num_retvals];
         TFE_Execute(op, rawReturns, ref num_retvals, status);
         for (var i = 0; i < num_retvals; i++)
         {
             // A handle is created for every return, even if rawReturns[i] is null. The resulting handle will be
             // non-null but invalid, which is the same behavior P/Invoke gives for non-array SafeHandle return
             // values.
             retvals[i] = new SafeTensorHandleHandle(rawReturns[i]);
         }
     }
 }
 public static extern SafeImportGraphDefResultsHandle TF_GraphImportGraphDefWithResults(IntPtr graph, SafeBufferHandle graph_def, SafeImportGraphDefOptionsHandle options, SafeStatusHandle status);
Exemple #11
0
 public static extern unsafe ulong TF_StringDecode(byte *src, ulong src_len, byte **dst, ref ulong dst_len, SafeStatusHandle status);
 public static extern unsafe void TF_GraphImportGraphDefWithReturnOutputs(IntPtr graph, SafeBufferHandle graph_def, SafeImportGraphDefOptionsHandle options, IntPtr return_outputs, int num_return_outputs, SafeStatusHandle status);
 public static extern void TF_GraphGetTensorShape(IntPtr graph, TF_Output output, long[] dims, int num_dims, SafeStatusHandle status);
 public static extern void TF_GraphGetOpDef(IntPtr graph, string op_name, SafeBufferHandle output_op_def, SafeStatusHandle status);
Exemple #15
0
 public static extern void TFE_OpAddInput(SafeOpHandle op, SafeTensorHandleHandle h, SafeStatusHandle status);
Exemple #16
0
 private static unsafe extern void TFE_Execute(SafeOpHandle op, IntPtr *retvals, ref int num_retvals, SafeStatusHandle status);
Exemple #17
0
 public static extern SafeTensorHandleHandle TFE_NewTensorHandle(IntPtr t, SafeStatusHandle status);
Exemple #18
0
 public static extern SafeOpHandle TFE_NewOp(SafeContextHandle ctx, string op_or_function_name, SafeStatusHandle status);
Exemple #19
0
 public static extern int TFE_TensorHandleNumDims(SafeTensorHandleHandle h, SafeStatusHandle status);
Exemple #20
0
 public static extern void TFE_OpReset(SafeOpHandle op_to_reset, string op_or_function_name, string raw_device_name, SafeStatusHandle status);
Exemple #21
0
 public static extern TF_AttrType TFE_OpGetAttrType(SafeOpHandle op, string attr_name, ref byte is_list, SafeStatusHandle status);
Exemple #22
0
 public static extern void TFE_OpSetAttrShape(SafeOpHandle op, string attr_name, long[] dims, int num_dims, SafeStatusHandle out_status);
Exemple #23
0
 public static extern SafeDeviceListHandle TFE_ContextListDevices(SafeContextHandle ctx, SafeStatusHandle status);
Exemple #24
0
 public static extern void TFE_OpSetAttrShapeList(SafeOpHandle op, string attr_name, IntPtr[] dims, int[] num_dims, int num_values, SafeStatusHandle out_status);
Exemple #25
0
 public static extern void TFE_ExecutorWaitForAllPendingNodes(SafeExecutorHandle executor, SafeStatusHandle status);
Exemple #26
0
 public static extern void TFE_OpSetAttrValueProto(SafeOpHandle op, string attr_name, IMessage[] proto, int proto_len, SafeStatusHandle status);
Exemple #27
0
 public static extern int TFE_OpAddInputList(SafeOpHandle op, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeHandleArrayMarshaler))] SafeTensorHandleHandle[] inputs, int num_inputs, SafeStatusHandle status);
Exemple #28
0
 public static extern void TFE_OpSetDevice(SafeOpHandle op, string device_name, SafeStatusHandle status);
Exemple #29
0
 public static extern void TFE_ContextAddFunction(SafeContextHandle ctx, IntPtr function, SafeStatusHandle status);
 public static extern void TF_UpdateEdge(IntPtr graph, TF_Output new_src, TF_Input dst, SafeStatusHandle status);