mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
This reverts commit 60936e4c29.
Reverted https://github.com/pytorch/pytorch/pull/106914 on behalf of https://github.com/ZainRizvi due to Sorry, but this is breaking internal builds. Seems like a lot of internal code depends on some of the removed imports ([comment](https://github.com/pytorch/pytorch/pull/106914#issuecomment-1688605975))
29 lines
497 B
C++
29 lines
497 B
C++
#include <torch/csrc/jit/runtime/print_handler.h>
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
namespace torch {
|
|
namespace jit {
|
|
|
|
namespace {
|
|
|
|
std::atomic<PrintHandler> print_handler(getDefaultPrintHandler());
|
|
|
|
} // namespace
|
|
|
|
PrintHandler getDefaultPrintHandler() {
|
|
return [](const std::string& s) { std::cout << s; };
|
|
}
|
|
|
|
PrintHandler getPrintHandler() {
|
|
return print_handler.load();
|
|
}
|
|
|
|
void setPrintHandler(PrintHandler ph) {
|
|
print_handler.store(ph);
|
|
}
|
|
|
|
} // namespace jit
|
|
} // namespace torch
|