/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/serialization
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/serialization/python_print.h (1180B)
#pragma once
#include
#include
#include
#include
namespace torch {
namespace jit {
struct Method;
struct Module;
struct PythonPrintImpl;
struct PrintDepsTable {
void add(const c10::NamedTypePtr& type);
size_t size() const {
return table_.size();
}
const c10::NamedTypePtr& operator[](size_t index) const {
return table_[index];
}
private:
std::vector table_;
std::unordered_set non_unique_;
};
struct TORCH_API PythonPrint {
PythonPrint(
std::vector& constant_table,
PrintDepsTable& deps_table,
c10::TypePrinter type_printer = nullptr,
bool enforce_importable = false);
void printNamedType(const c10::NamedTypePtr& classType);
void printFunction(const Function& callee);
void printMethod(const Function& callee);
std::string str() const;
const SourceRangeRecords& ranges() const;
uint64_t minVersion() const;
~PythonPrint();
private:
std::shared_ptr pImpl;
};
TORCH_API bool printerHasSpecialCaseFor(c10::Symbol sym);
} // namespace jit
} // namespace torch