Exemple #1
0
        public unsafe TF_Input[] OutputConsumers(int index, int max_consumers)
        {
            var handle    = Marshal.AllocHGlobal(Marshal.SizeOf <TF_Input>());
            int num       = c_api.TF_OperationOutputConsumers(new TF_Output(_handle, index), handle, max_consumers);
            var consumers = new TF_Input[num];
            var inputptr  = (TF_Input *)handle;

            for (int i = 0; i < num; i++)
            {
                consumers[i] = *(inputptr + i);
            }

            return(consumers);
        }
        public unsafe TF_Input[] OutputConsumers(int index, int max_consumers)
        {
            int size      = Marshal.SizeOf <TF_Input>();
            var handle    = Marshal.AllocHGlobal(size);
            int num       = c_api.TF_OperationOutputConsumers(new TF_Output(_handle, index), handle, max_consumers);
            var consumers = new TF_Input[num];

            for (int i = 0; i < num; i++)
            {
                consumers[i] = Marshal.PtrToStructure <TF_Input>(handle + i * size);
            }

            return(consumers);
        }
        public static string[] TF_OperationOutputConsumers_wrapper(TF_Output oper_out)
        {
            int num_consumers = TF_OperationOutputNumConsumers(oper_out);
            int size          = Marshal.SizeOf <TF_Input>();
            var handle        = Marshal.AllocHGlobal(size * num_consumers);
            int num           = TF_OperationOutputConsumers(oper_out, handle, num_consumers);
            var consumers     = new string[num_consumers];

            for (int i = 0; i < num; i++)
            {
                TF_Input input = Marshal.PtrToStructure <TF_Input>(handle + i * size);
                consumers[i] = Marshal.PtrToStringAnsi(TF_OperationName(input.oper));
            }

            return(consumers);
        }
        /// <summary>
        /// Create and return a new TF_Input for input_idx'th input of this op.
        /// </summary>
        public TF_Input _tf_input(int input_idx)
        {
            var tf_input = new TF_Input(op, input_idx);

            return(tf_input);
        }
 public static extern void UpdateEdge(IntPtr graph, TF_Output new_src, TF_Input dst, IntPtr status);
Exemple #6
0
 public static extern void TF_UpdateEdge(IntPtr graph, TF_Output new_src, TF_Input dst, SafeStatusHandle status);
 public static extern TF_DataType TF_OperationInputType(TF_Input oper_in);
 public static extern TF_Output TF_OperationInput(TF_Input oper_in);