示例#1
0
        /*
         * private Interpreter()
         * {
         *  _ptr = TfLiteInvoke.tfeInterpreterCreate();
         * }*/

        /// <summary>
        /// Create an interpreter from a flatbuffer model
        /// </summary>
        /// <param name="flatBufferModel">The flat buffer model.</param>
        /// <param name="resolver">An instance that implements the Resolver interface which maps custom op names and builtin op codes to op registrations.</param>
        public Interpreter(FlatBufferModel flatBufferModel, IOpResolver resolver = null)
        {
            if (resolver == null)
            {
                using (BuildinOpResolver buildinResolver = new BuildinOpResolver())
                {
                    _ptr = TfLiteInvoke.tfeInterpreterCreateFromModel(flatBufferModel.Ptr, ((IOpResolver)buildinResolver).OpResolverPtr);
                }
            }
            else
            {
                _ptr = TfLiteInvoke.tfeInterpreterCreateFromModel(flatBufferModel.Ptr, resolver.OpResolverPtr);
            }
        }
示例#2
0
        /*
         * private Interpreter()
         * {
         *  _ptr = TfLiteInvoke.tfeInterpreterCreate();
         * }*/

        public Interpreter(FlatBufferModel flatBufferModel, IOpResolver resolver)
        {
            _ptr = TfLiteInvoke.tfeInterpreterCreateFromModel(flatBufferModel.Ptr, resolver.OpResolverPtr);
        }
示例#3
0
 /// <summary>
 /// Create an interpreter from a flatbuffer model
 /// </summary>
 /// <param name="flatBufferModel">The flat buffer model.</param>
 /// <param name="resolver">An instance that implements the Resolver interface which maps custom op names and builtin op codes to op registrations.</param>
 public Interpreter(FlatBufferModel flatBufferModel, IOpResolver resolver = null)
     : this()
 {
     Build(flatBufferModel, resolver);
 }