pytorch/torch/csrc/jit/print_handler.h
James Reed c2a18a6702 Override print when python is present (#21625)
Summary:
This makes it so we can see the output of prim::Print in environments like iPython notebooks which override sys.stdout
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21625

Differential Revision: D15756793

Pulled By: jamesr66a

fbshipit-source-id: 7d9a14b2e229ed358e784318e9d862677db2c461
2019-06-11 22:58:22 -07:00

19 lines
340 B
C++

#pragma once
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <atomic>
#include <functional>
#include <iostream>
namespace torch {
namespace jit {
using PrintHandler = void (*)(const std::string&);
TORCH_API void setPrintHandler(PrintHandler ph);
TORCH_API PrintHandler getPrintHandler();
} // namespace jit
} // namespace torch