pytorch/torch/csrc/jit/script/compiler.h
Adam Paszke a0118533ef
Add a print() function to the JIT script (#5274)
Additionally:
- add support for calling functions that are not methods in the Python frontend
- add an end-to-end test for the Python frontend
- add a capture_stdout helper for checking that `print` actually works
2018-02-24 11:15:55 +01:00

29 lines
626 B
C++

#pragma once
#include <memory>
#include <string>
#include "torch/csrc/jit/ir.h"
#include "torch/csrc/jit/script/tree_views.h"
namespace torch {
namespace jit {
namespace script {
struct CompilationUnitImpl;
struct CompilationUnit {
CompilationUnit();
void define(const std::string& source);
void defineFunction(const Def& def);
std::shared_ptr<Graph> getGraph(const std::string& func_name);
~CompilationUnit();
private:
std::unique_ptr<CompilationUnitImpl> pImpl;
};
std::unique_ptr<CompilationUnit> jitScriptCompile(const std::string& script);
} // namespace script
} // namespace jit
} // namespace torch