Ejemplo n.º 1
0
        public string Generate()
        {
            string result     = "";
            string json       = "";
            string moduleName = "image";

            using (var gil = Py.GIL())
            {
                dynamic exporter = PythonEngine.ModuleFromString("exporter", File.ReadAllText("./mxnet/ExportSignatureToJson.py").Replace("[MODULE]", "mxnet." + moduleName));
                json = exporter.generate().ToString();
            }

            var library = PyLibrary.LoadJson(json);

            foreach (var item in library.Modules)
            {
                if (item.Name.Contains("._") || item.Name.Contains(".gen_"))
                {
                    continue;
                }

                GenerateCode(item, "/image/", "image");
            }

            return(result);
        }
Ejemplo n.º 2
0
        public string Generate()
        {
            string result = "";
            string json   = "";

            using (var gil = Py.GIL())
            {
                dynamic exporter = PythonEngine.ModuleFromString("exporter", File.ReadAllText("./keras/ExportSignatureToJson.py"));
                json = exporter.generate().ToString();
            }

            var library = PyLibrary.LoadJson(json);

            GenerateCode("callbacks", library);

            return(result);
        }