Esempio n. 1
0
        private static void Generate(string inFile, string configFile, string commonConfigFile, string outFile)
        {
            var ast = JObject.Parse(File.ReadAllText(inFile), new JsonLoadSettings()
            {
                LineInfoHandling = LineInfoHandling.Load
            });

            var config = Config.Load(configFile, commonConfigFile);

            var formatter = new Formatter();
            var generator = new Generator(formatter, config);

            // MXNet specific generators
            generator.AddHook(new MXNet.UFuncHelperHook(generator.Out, generator.Config));
            generator.AddHook(new MXNet.CTypesPointerHook(generator.Out, generator.Config));

            generator.Generate(ast.Root, new Context());

            File.WriteAllText(outFile, formatter.GetOutput());
        }