1 #include <torch/csrc/jit/passes/inplace_check.h> 6 void CheckInplace(Block* block) {
7 for (
auto node : block->nodes()) {
8 if (node->kind() == prim::PythonOp && node->hasAttribute(attr::inplace)) {
9 if (node->i(attr::inplace)) {
10 throw std::runtime_error(
11 std::string(
"inplace ") + static_cast<PythonOp*>(node)->name() +
12 " not supported in the JIT");
18 void CheckInplace(std::shared_ptr<Graph>& graph) {
19 CheckInplace(graph->block());